mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-20 23:14:27 +00:00
fixup 28ffcc54483942c598d24cecd4f65534f0185c51
I didn't see that store_carryover(state_of_game, playcontroller, disp, end_level); uses end_level.
This commit is contained in:
parent
28ffcc5448
commit
b6efcec496
@ -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();
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user