Skip to content

Commit

Permalink
fix assertion failure when loading mp saves
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Feb 15, 2016
1 parent b753e54 commit 6e0f8ed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/actions/undo.cpp
Expand Up @@ -457,8 +457,6 @@ bool undo_list::apply_shroud_changes() const
if ( tm.auto_shroud_updates() || !tm.fog_or_shroud() ) {
return false;
}
// If we clear fog or shroud outside a synced context we get OOS
assert(synced_context::is_synced());
shroud_clearer clearer;
bool cleared_shroud = false;
const size_t list_size = undos_.size();
Expand All @@ -482,9 +480,16 @@ bool undo_list::apply_shroud_changes() const
}
}


if (!cleared_shroud) {
return false;
}
// If we clear fog or shroud outside a synced context we get OOS
// Note that it can happen that we call this function from ouside a synced context
// when we reload a game and want to prevent undoing. But in this case this is
// preceeded by a manual update_shroud call so that cleared_shroud is false.
assert(synced_context::is_synced());

// The entire stack needs to be cleared in order to preserve replays.
// (The events that fired might depend on current unit positions.)
// (Also the events that did not fire might depend on unit positions (they whould have fired if the unit would have standed on different positions, for example this can happen if they have a [have_unit] in [filter_condition]))
Expand Down

0 comments on commit 6e0f8ed

Please sign in to comment.