From afa79bcc5d50f48c2f0d68f5fa5593bd4659001d Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 16 Jan 2025 15:27:04 -0600 Subject: [PATCH] prevent edge case in interrupting replays --- src/game/boe.actions.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index 3f6ebe1f..81d1ac95 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -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; }