fixes a crash if an invalid scenario was loaded (bug #9049)

This commit is contained in:
Mark de Wever 2007-05-01 15:32:38 +00:00
parent 39ea75b4da
commit eb494e7e65
2 changed files with 5 additions and 2 deletions

View file

@ -13,6 +13,7 @@ Version 1.3.2+svn:
the standard location filter provided inside the tag
* Miscellaneous and bugfixes
* 1.2 savegames are no longer compatible and thus not loaded
* fixed a crash if an invalid scenario was loaded (bug #9049)
Version 1.3.2:
* campaigns

View file

@ -147,8 +147,10 @@ LEVEL_RESULT play_game(display& disp, game_state& gamestate, const config& game_
} else {
LOG_G << "loading scenario: '" << gamestate.scenario << "'\n";
scenario = game_config.find_child(type,"id",gamestate.scenario);
starting_pos = *scenario;
gamestate.starting_pos = *scenario;
if(scenario) {
starting_pos = *scenario;
gamestate.starting_pos = *scenario;
}
LOG_G << "scenario found: " << (scenario != NULL ? "yes" : "no") << "\n";
}
} else {