Only show bullet hits for shovable gears
authoralfadur
Tue, 11 Sep 2018 22:49:27 +0200
changeset 13775 8a7699ccb608
parent 13774 506cca5a48cb
child 13776 720dc03600c9
Only show bullet hits for shovable gears Fixes some weird bullet hit vgears spawning when hitting non-shovable gears like snowflakes
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsUtils.pas	Tue Sep 11 22:44:32 2018 +0200
+++ b/hedgewars/uGearsUtils.pas	Tue Sep 11 22:49:27 2018 +0200
@@ -1332,18 +1332,9 @@
     if (Gear^.State and gstNoDamage) = 0 then
         begin
 
-        if (not (Gear^.Kind in [gtMinigun, gtPortal])) and
-            (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet]) then
-            begin
-            VGear := AddVisualGear(t^.cX[i], t^.cY[i], vgtBulletHit);
-            if VGear <> nil then
-                VGear^.Angle := DxDy2Angle(-Ammo^.dX, Ammo^.dY);
-            end;
-
         if (Gear^.Kind = gtHedgehog) and (Ammo^.State and gsttmpFlag <> 0) and (Ammo^.Kind = gtShover) then
             Gear^.FlightTime:= 1;
 
-
         case Gear^.Kind of
             gtHedgehog,
             gtMine,
@@ -1355,6 +1346,12 @@
             gtExplosives: //,
             //gtStructure:
             begin
+            if Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet] then
+                begin
+                VGear := AddVisualGear(t^.cX[i], t^.cY[i], vgtBulletHit);
+                if VGear <> nil then
+                    VGear^.Angle := DxDy2Angle(-Ammo^.dX, Ammo^.dY);
+                end;
             if (Ammo^.Kind = gtDrill) then
                 begin
                 Ammo^.Timer:= 0;