Apply hit animation ONLY to bullets
authorPalewolf
Sun, 14 Nov 2010 13:14:05 +0100
changeset 4329 5e5fbe5337e1
parent 4327 224efdd648e1
child 4331 6b946b93761f
Apply hit animation ONLY to bullets
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sun Nov 14 12:57:01 2010 +0100
+++ b/hedgewars/uGears.pas	Sun Nov 14 13:14:05 2010 +0100
@@ -1447,10 +1447,13 @@
     if (Gear^.State and gstNoDamage) = 0 then
         begin
         
-        VGear := AddVisualGear(hwround(Ammo^.X), hwround(Ammo^.Y), vgtBulletHit);
-        if VGear <> nil then
+        if (Ammo^.Kind = gtDEagleShot) or (Ammo^.Kind = gtSniperRifleShot) then 
         begin
-            VGear^.Angle := DxDy2Angle(-Ammo^.dX, Ammo^.dY);
+            VGear := AddVisualGear(hwround(Ammo^.X), hwround(Ammo^.Y), vgtBulletHit);
+            if VGear <> nil then
+            begin
+                VGear^.Angle := DxDy2Angle(-Ammo^.dX, Ammo^.dY);
+            end;
         end;
         
         if (Gear^.Kind = gtHedgehog) and (Ammo^.State and gsttmpFlag <> 0) and (Ammo^.Kind = gtShover) then Gear^.FlightTime:= 1;