and finally make the bat hit moving gears for completeness
authoralfadur
Sat, 27 Oct 2018 08:12:22 +0300
changeset 14009 d203bb36225f
parent 14008 967ed77d6aef
child 14010 fb9ed6adef05
and finally make the bat hit moving gears for completeness
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sat Oct 27 07:53:27 2018 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Oct 27 08:12:22 2018 +0300
@@ -2566,7 +2566,12 @@
     if Gear^.Timer = 0 then
         begin
         inc(Gear^.Tag);
-        Gear^.Timer := 50
+        Gear^.Timer := 50;
+        if Gear^.Tag = 3 then
+            begin
+            ClearHitOrder();
+            RefillProximityCache(Gear, 100);
+            end;
         end;
 
     if Gear^.Tag = 3 then
@@ -2575,12 +2580,14 @@
         HHGear^.State := HHGear^.State or gstNoDamage;
         DeleteCI(HHGear);
 
-        AmmoShove(Gear, Gear^.Boom, 115);
+        AmmoShoveCache(Gear, Gear^.Boom, 115);
 
         HHGear^.State := (HHGear^.State and (not gstNoDamage)) or gstMoving;
         end
     else if Gear^.Tag = 4 then
         begin
+        ClearHitOrder();
+        ClearProximityCache();
         Gear^.Timer := 250;
         Gear^.doStep := @doStepIdle
         end
--- a/hedgewars/uGearsUtils.pas	Sat Oct 27 07:53:27 2018 +0300
+++ b/hedgewars/uGearsUtils.pas	Sat Oct 27 08:12:22 2018 +0300
@@ -1322,7 +1322,7 @@
     dec(i);
     Gear:= t^.ar[i];
     if (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet,
-                       gtFirePunch, gtKamikaze, gtWhip])
+                       gtFirePunch, gtKamikaze, gtWhip, gtShover])
         and (((Ammo^.Data <> nil) and (PGear(Ammo^.Data) = Gear))
              or (not UpdateHitOrder(Gear, Ammo^.WDTimer))) then
         continue;