Don't remove gstWinner after GameOver
authorWuzzy <Wuzzy2@mail.ru>
Mon, 13 May 2019 20:25:32 +0200 (2019-05-13)
changeset 14926 60340c8a6fae
parent 14925 d2f5b6b01846
child 14927 9d6a25239d00
Don't remove gstWinner after GameOver
hedgewars/uGearsHedgehog.pas
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsHedgehog.pas	Mon May 13 14:19:45 2019 -0400
+++ b/hedgewars/uGearsHedgehog.pas	Mon May 13 20:25:32 2019 +0200
@@ -1219,7 +1219,8 @@
 if (not isFalling)
   and (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _0_03) then
     begin
-    Gear^.State:= Gear^.State and (not gstWinner);
+    if (not GameOver) then
+        Gear^.State:= Gear^.State and (not gstWinner);
     Gear^.State:= Gear^.State and (not gstMoving);
     cnt:= 0;
     while (cnt < 6) and (not CheckGearDrowning(Gear)) and (Gear <> nil) and (TestCollisionYWithGear(Gear,1) = 0) do
@@ -1511,7 +1512,9 @@
     begin
     if Gear^.Timer = 0 then
         begin
-        Gear^.State:= Gear^.State and (not (gstWait or gstLoser or gstWinner or gstAttacked or gstNotKickable or gstChooseTarget));
+        Gear^.State:= Gear^.State and (not (gstWait or gstLoser or gstAttacked or gstNotKickable or gstChooseTarget));
+        if (not GameOver) then
+            Gear^.State:= Gear^.State and (not gstWinner);
         if Gear^.Hedgehog^.Effects[heFrozen] = 0 then Gear^.Active:= false;
         AddCI(Gear);
         exit
--- a/hedgewars/uGearsUtils.pas	Mon May 13 14:19:45 2019 -0400
+++ b/hedgewars/uGearsUtils.pas	Mon May 13 20:25:32 2019 +0200
@@ -173,7 +173,11 @@
                                 Gear^.State:= (Gear^.State or gstMoving) and (not gstLoser);
                                 if Gear^.Kind = gtKnife then Gear^.State:= Gear^.State and (not gstCollision);
                                 if (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heInvulnerable] = 0) then
-                                    Gear^.State:= (Gear^.State or gstMoving) and (not (gstWinner or gstHHJumping or gstHHHJump));
+                                    begin
+                                    Gear^.State:= (Gear^.State or gstMoving) and (not (gstHHJumping or gstHHHJump));
+                                    if (not GameOver) then
+                                        Gear^.State:= (Gear^.State and (not gstWinner));
+                                    end;
                                 Gear^.Active:= true;
                                 if Gear^.Kind <> gtFlame then FollowGear:= Gear;
                                 if Gear^.Kind = gtAirMine then