Fix assertion error on [allow_undo] misuse
Previously it could happen that the replay recorder was not at end after redoing if redo() pushed additional user choices to the recorderwhihc were not used by the actual code (this can happen if the game is out of sync)
This commit is contained in:
parent
c284a080e3
commit
75be3f0c29
1 changed files with 4 additions and 0 deletions
|
@ -406,6 +406,10 @@ void undo_list::redo()
|
|||
redos_list temp;
|
||||
temp.swap(redos_);
|
||||
synced_context::run(commandname, data, /*use_undo*/ true, /*show*/ true, error_handler);
|
||||
if(!resources::recorder->at_end()) {
|
||||
error_handler(_"Unhandled choices while redoing");
|
||||
resources::recorder->set_to_end();
|
||||
}
|
||||
temp.swap(redos_);
|
||||
|
||||
// Screen updates.
|
||||
|
|
Loading…
Add table
Reference in a new issue