Fixed a crash when starting with wesnoth --multiplayer

YogiHH please review the changes.

The bug was introduced while fixing bug #8308, after the fix the
tutorial still behaves as it should.
This commit is contained in:
Mark de Wever 2007-01-25 18:39:41 +00:00
parent 60747af7d2
commit a10982b43e

View file

@ -143,7 +143,11 @@ LEVEL_RESULT play_game(display& disp, game_state& gamestate, const config& game_
LOG_G << "loading snapshot...\n";
starting_pos = gamestate.starting_pos;
scenario = &gamestate.snapshot;
gamestate.variables = *gamestate.snapshot.child("variables");
// when starting wesnoth --multiplayer there might be
// no variables which leads to a segfault
if(gamestate.snapshot.child("variables") != NULL) {
gamestate.variables = *gamestate.snapshot.child("variables");
}
}
controller_map controllers;