prevent firepunch from hitting the same gear multiple times
authoralfadur
Sat, 27 Oct 2018 05:17:46 +0300
changeset 14010 31bdb759d98b
parent 14009 97e48a6c2535
child 14011 105793e575d6
prevent firepunch from hitting the same gear multiple times
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sat Oct 27 03:36:25 2018 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Oct 27 05:17:46 2018 +0300
@@ -2823,6 +2823,7 @@
     if not (HHGear^.dY.isNegative) or (Gear^.Timer = 0) then
         begin
         HHGear^.State := HHGear^.State or gstMoving;
+        ClearHitOrder();
         DeleteGear(Gear);
         AfterAttack;
         exit
@@ -2845,6 +2846,8 @@
 
     HHGear^.dY := - _0_3;
 
+    ClearHitOrder();
+
     Gear^.X := HHGear^.X;
     Gear^.dX := SignAs(_0_45, Gear^.dX);
     Gear^.dY := - _0_9;
--- a/hedgewars/uGearsUtils.pas	Sat Oct 27 03:36:25 2018 +0200
+++ b/hedgewars/uGearsUtils.pas	Sat Oct 27 05:17:46 2018 +0300
@@ -1320,7 +1320,7 @@
     begin
     dec(i);
     Gear:= t^.ar[i];
-    if (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet])
+    if (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet, gtFirePunch])
         and (((Ammo^.Data <> nil) and (PGear(Ammo^.Data) = Gear))
              or (not UpdateHitOrder(Gear, Ammo^.WDTimer))) then
         continue;