Fix commit a323e1954a6f, allow exiting Confirm state by keypress in addition to mousepress without aborting the ready timer draft
authorS.D.
Sun, 30 Oct 2022 18:29:29 +0200
changeset 15914 08b88572b1c2
parent 15909 7409084d891f
child 15915 35d26863a88e
Fix commit a323e1954a6f, allow exiting Confirm state by keypress in addition to mousepress without aborting the ready timer
hedgewars/uInputHandler.pas
--- a/hedgewars/uInputHandler.pas	Sun Oct 16 20:15:57 2022 +0300
+++ b/hedgewars/uInputHandler.pas	Sun Oct 30 18:29:29 2022 +0200
@@ -237,7 +237,8 @@
     // Check if the keypress should end the ready phase.
     // Camera movement keys are "safe" since its equivalent to moving the mouse,
     // which also does not end the ready phase.
-    readyAborter:= (GameState <> gsConfirm) and (curBind <> '+cur_u') and (curBind <> '+cur_d') and (curBind <> '+cur_l') and (curBind <> '+cur_r');
+    // Also allow exiting Confirm state (quit prompt) without aborting the ready timer.
+    readyAborter:= not ((GameState = gsConfirm) and (curBind = 'quit')) and (curBind <> '+cur_u') and (curBind <> '+cur_d') and (curBind <> '+cur_l') and (curBind <> '+cur_r');
 
     if (code < cKeyMaxIndex - 2) // means not mouse buttons
         and KeyDown