hedgewars/uGearsUtils.pas
changeset 13408 9c9d29be9e00
parent 13404 3d6aae2ae698
child 13412 06792533ef91
--- a/hedgewars/uGearsUtils.pas	Thu May 24 09:51:11 2018 -0400
+++ b/hedgewars/uGearsUtils.pas	Thu May 24 13:04:56 2018 -0400
@@ -1291,8 +1291,9 @@
     begin
     dec(i);
     Gear:= t^.ar[i];
-    if (Ammo^.Data <> nil) and (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet]) and (PGear(Ammo^.Data) = Gear)
-    or ((Ammo^.Kind = gtMinigunBullet) and (not UpdateHitOrder(Gear, Ammo^.WDTimer))) then
+    if (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet])
+        and (((Ammo^.Data <> nil) and (PGear(Ammo^.Data) = Gear))
+             or (not UpdateHitOrder(Gear, Ammo^.WDTimer))) then
         continue;
 
     if ((Ammo^.Kind = gtFlame) or (Ammo^.Kind = gtBlowTorch)) and
@@ -1303,9 +1304,7 @@
         begin
 
         if (not (Gear^.Kind in [gtMinigun, gtPortal])) and
-            ((Ammo^.Kind = gtDEagleShot)
-                or (Ammo^.Kind = gtSniperRifleShot)
-                or (Ammo^.Kind = gtMinigunBullet)) then
+            (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet]) then
             begin
             VGear := AddVisualGear(t^.cX[i], t^.cY[i], vgtBulletHit);
             if VGear <> nil then
@@ -1413,10 +1412,7 @@
 procedure AmmoShoveLine(Ammo: PGear; Damage, Power: LongInt; oX, oY, tX, tY: hwFloat);
 var t: PGearArray;
 begin
-    if Ammo^.Kind = gtMinigunBullet then
-        t:= CheckAllGearsLineCollision(Ammo, oX, oY, tX, tY)
-    else
-        t:= CheckGearsLineCollision(Ammo, oX, oY, tX, tY);
+    t:= CheckAllGearsLineCollision(Ammo, oX, oY, tX, tY);
     AmmoShoveImpl(Ammo, Damage, Power, t);
 end;