Skip to content

Commit

Permalink
ADD: command-line parameter -scenario also looks in addons directory
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@10275 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
Dwachs authored and teamhimeh committed Nov 30, 2023
1 parent bbb895d commit 923fc28
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion simmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,15 @@ int simu_main(int argc, char** argv)
intr_set_view(view);
win_set_world(welt);

const char *err = scen->init((env_t::data_dir + env_t::objfilename + "scenario/").c_str(), scen_name, welt);
const char *err = "";
if (env_t::default_settings.get_with_private_paks()) {
// try addon directory first
err = scen->init(("addons/" + env_t::objfilename + "scenario/").c_str(), scen_name, welt);
}
if (err) {
// no addon scenario, look in pakset
err = scen->init((env_t::data_dir + env_t::objfilename + "scenario/").c_str(), scen_name, welt);
}
if( err ) {
dbg->error("simu_main()", "Could not load scenario %s%s: %s", env_t::objfilename.c_str(), scen_name, err);
delete scen;
Expand Down

0 comments on commit 923fc28

Please sign in to comment.