Skip to content

Commit

Permalink
fixup 28ffcc5
Browse files Browse the repository at this point in the history
I didn't see that store_carryover(state_of_game, playcontroller, disp, end_level); uses end_level.
  • Loading branch information
gfgtdf committed May 29, 2014
1 parent 28ffcc5 commit b6efcec
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/playcampaign.cpp
Expand Up @@ -292,6 +292,10 @@ static LEVEL_RESULT playsingle_scenario(const config& game_config,

LEVEL_RESULT res = playcontroller.play_scenario(story, skip_replay);

end_level = playcontroller.get_end_level_data_const();
config& cfg_end_level = state_of_game.carryover_sides.child_or_add("end_level_data");
end_level.write(cfg_end_level);

if (res == DEFEAT) {
if (resources::persist != NULL)
resources::persist->end_transaction();
Expand All @@ -315,10 +319,6 @@ static LEVEL_RESULT playsingle_scenario(const config& game_config,
}
}

end_level = playcontroller.get_end_level_data_const();
config& cfg_end_level = state_of_game.carryover_sides.child_or_add("end_level_data");
end_level.write(cfg_end_level);

return res;
}

Expand All @@ -339,6 +339,10 @@ static LEVEL_RESULT playmp_scenario(const config& game_config,
game_config, disp.video(), skip_replay, blindfold_replay, io_type == IO_SERVER);
LEVEL_RESULT res = playcontroller.play_scenario(story, skip_replay);

end_level = playcontroller.get_end_level_data_const();
config& cfg_end_level = state_of_game.carryover_sides.child_or_add("end_level_data");
end_level.write(cfg_end_level);

//Check if the player started as mp client and changed to host
if (io_type == IO_CLIENT && playcontroller.is_host())
io_type = IO_SERVER;
Expand Down Expand Up @@ -368,10 +372,6 @@ static LEVEL_RESULT playmp_scenario(const config& game_config,
}
}

end_level = playcontroller.get_end_level_data_const();
config& cfg_end_level = state_of_game.carryover_sides.child_or_add("end_level_data");
end_level.write(cfg_end_level);

return res;
}

Expand Down

0 comments on commit b6efcec

Please sign in to comment.