From 98c41ba667d4ff0334dee9bf7bc98b98e300e823 Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Sat, 16 Jul 2022 02:10:22 +0200 Subject: [PATCH] Fix loading scenarios once installed After it is installed, Freeciv21 is supposed to find its default set of scenarios independent from where it's started from. Use default_data_path() to build a list of paths to search in. Closes #1133. --- utility/shared.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utility/shared.cpp b/utility/shared.cpp index b7c3f170cd..6611728d08 100644 --- a/utility/shared.cpp +++ b/utility/shared.cpp @@ -71,10 +71,11 @@ static QStringList default_save_path() static QStringList default_scenario_path() { - return {QStringLiteral("."), QStringLiteral("data/scenarios"), - freeciv_storage_dir() - + QStringLiteral("/" DATASUBDIR "/scenarios"), - freeciv_storage_dir() + QStringLiteral("/scenarios")}; + auto paths = default_data_path(); + for (auto &path : paths) { + path += QStringLiteral("/scenarios"); + } + return paths; } /* Both of these are stored in the local encoding. The grouping_sep must