Fix assert-crash spotted by loonycyborg in test-scenario
(dismissing troll after a move leaving the undo-stack not empty) Current fix has the small flaw that a unit WML-killed by an event will not clear the shroud explored by its previous move (if delay shroud is on)
This commit is contained in:
parent
6be85c276f
commit
4ecb0a95c3
1 changed files with 5 additions and 1 deletions
|
@ -2576,7 +2576,11 @@ void apply_shroud_changes(undo_list& undos, game_display* disp, const gamemap& m
|
|||
|
||||
// Make a temporary unit move in map and hide the original
|
||||
unit_map::iterator unit_itor = units.find(un->affected_unit.underlying_id());
|
||||
assert(unit_itor != units.end());
|
||||
// check if the unit is still existing (maybe killed by an event)
|
||||
// FIXME: A wml-killed unit will not update the shroud explored before its death
|
||||
if(unit_itor == units.end())
|
||||
continue;
|
||||
|
||||
unit temporary_unit(unit_itor->second);
|
||||
// We're not really going to mutate the unit, just temporarily
|
||||
// set its moves to maximum, but then switch them back.
|
||||
|
|
Loading…
Add table
Reference in a new issue