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:
parent
138f7c92c4
commit
58228b5d28
1 changed files with 2 additions and 3 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue