prevent edge case in interrupting replays

This commit is contained in:
2025-01-16 15:27:04 -06:00
parent 78e3c46b05
commit afa79bcc5d

View File

@@ -3779,7 +3779,15 @@ bool check_for_interrupt(std::string confirm_dialog){
record_action("handle_interrupt", "");
}
cChoiceDlog confirm(confirm_dialog, {"quit","cancel"});
if(confirm.show() == "quit") return true;
bool was_replaying = replaying;
if(confirm_dialog == "confirm-interrupt-replay"){
// There's a slight chance the next action could be snatched up by the replay system to respond
// to the yes/no prompt, so suspend the replay loop
replaying = false;
}
std::string result = confirm.show();
replaying = was_replaying;
if(result == "quit") return true;
}
return false;
}