clear the redo stack when toggeling shroud updates

The previous behaviour causes OOS, assume this situation:
Player1s turn, DSU is activated, player1 moves  a unit and then undoes
the move. then he deactivates dsu and redoes the move. The result is
that the move did not uncover shroud (but it should since the move was
now done after DSU was deactivated).
This commit is contained in:
gfgtdf 2015-05-19 15:59:12 +02:00
parent 138f7c92c4
commit 58228b5d28

View file

@ -159,7 +159,7 @@ void undo_list::add_auto_shroud(bool turned_on)
/// @todo: Consecutive shroud actions can be collapsed into one.
// Do not call add(), as this should not clear the redo stack.
undos_.push_back(new undo::auto_shroud_action(turned_on));
add(new undo::auto_shroud_action(turned_on));
}
/**
@ -209,8 +209,7 @@ void undo_list::add_update_shroud()
{
/// @todo: Consecutive shroud actions can be collapsed into one.
// Do not call add(), as this should not clear the redo stack.
undos_.push_back(new undo::update_shroud_action());
add(new undo::update_shroud_action());
}