move scenario hash generation to expand_scenario

This commit is contained in:
gfgtdf 2014-07-31 03:17:03 +02:00 committed by gfgtdf
parent ab0dc2466d
commit 534dae2ec2
2 changed files with 3 additions and 3 deletions

View file

@ -373,9 +373,6 @@ LEVEL_RESULT play_game(game_display& disp, saved_game& gamestate,
if (io_type == IO_SERVER && gamestate.valid()) {
//note that although starting_pos is const it might be changed by gamestate.some_non_const_operation() .
const config& starting_pos = gamestate.get_starting_pos();
// A hash have to be generated using an unmodified
// scenario data.
gamestate.mp_settings().hash = starting_pos.hash();
//We don't merge WML until start of next scenario, but if we want to allow user to disable MP ui in transition,
//then we have to move "allow_new_game" attribute over now.

View file

@ -215,6 +215,9 @@ void saved_game::expand_scenario()
{
this->starting_pos_type_ = STARTINGPOS_SCENARIO;
this->starting_pos_ = scenario;
// A hash has to be generated using an unmodified scenario data.
mp_settings_.hash = scenario.hash();
update_label();
//Set this default value immideately after reading the scenario is importent because otherwise