Check for victory before stTurnReact. Fixes 382
authorWuzzy <Wuzzy2@mail.ru>
Sat, 01 Sep 2018 23:03:56 +0200
changeset 13737 8092b54ba19d
parent 13736 c6154fcb9420
child 13738 2ac3658a2a13
Check for victory before stTurnReact. Fixes 382
ChangeLog.txt
hedgewars/uGears.pas
--- a/ChangeLog.txt	Sat Sep 01 21:56:12 2018 +0200
+++ b/ChangeLog.txt	Sat Sep 01 23:03:56 2018 +0200
@@ -30,6 +30,7 @@
  * Fix /hta, /hsa and /hya commands not writing message in chat
  * Limit hedgehog health to 268435455 to prevent some bugs
  * Fix Sudden Death starting in the second turn of a round rather than the first
+ * Prevent voices from being spoken directly before a victory voice
 
 Frontend:
  + Add setting to disable audio dampening when losing window focus
--- a/hedgewars/uGears.pas	Sat Sep 01 21:56:12 2018 +0200
+++ b/hedgewars/uGears.pas	Sat Sep 01 23:03:56 2018 +0200
@@ -62,8 +62,8 @@
 
 var delay: LongWord;
     delay2: LongWord;
-    step: (stInit, stDelay, stChDmg, stSweep, stTurnReact,
-    stAfterDelay, stChWin, stWater, stChWin2, stHealth,
+    step: (stInit, stDelay, stChDmg, stSweep, stChWin1, stTurnReact,
+    stAfterDelay, stChWin2, stWater, stChWin3, stHealth,
     stSpawn, stNTurn);
     NewTurnTick: LongWord;
     //SDMusic: shortstring;
@@ -289,6 +289,12 @@
     else
         inc(step);
 
+    stChWin1:
+        begin
+        CheckForWin();
+        inc(step)
+        end;
+
     stTurnReact:
         begin
         if (not bBetweenTurns) and (not isInMultiShoot) then
@@ -310,7 +316,7 @@
         if delay = 0 then
             inc(step)
             end;
-    stChWin:
+    stChWin2:
         begin
         CheckForWin();
         inc(step)
@@ -327,7 +333,7 @@
         end
     else // since we are not raising the water, a second win-check isn't needed
         inc(step,2);
-    stChWin2:
+    stChWin3:
         begin
         CheckForWin;
         inc(step)