Skip to content

Commit

Permalink
Fix loading scenarios once installed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lmoureaux authored and jwrober committed Jul 16, 2022
1 parent 3eef957 commit 98c41ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions utility/shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 98c41ba

Please sign in to comment.