Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
gfgtdf
d4a07b0148
f 2024-10-24 23:13:44 +02:00
gfgtdf
75be3f0c29
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)
2024-10-24 23:08:25 +02:00

View file

@ -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.