fix possible 'manditory child missing' when loading mp campaign games
the error could happen a soon as you advance to the next scenario if you reload a campaign save from another player.
This commit is contained in:
parent
03d0e5deee
commit
575e104ca5
1 changed files with 3 additions and 1 deletions
|
@ -119,7 +119,9 @@ config initial_level_config(saved_game& state)
|
|||
const std::vector<std::string>& mods = params.active_mods;
|
||||
|
||||
for(unsigned i = 0; i < mods.size(); ++i) {
|
||||
level.add_child("modification", game_config.find_child("modification", "id", mods[i]));
|
||||
if(const config& mod_cfg = game_config.find_child("modification", "id", mods[i])) {
|
||||
level.add_child("modification", mod_cfg);
|
||||
}
|
||||
}
|
||||
|
||||
// This will force connecting clients to be using the same version number as us.
|
||||
|
|
Loading…
Add table
Reference in a new issue