hedgewars/uGears.pas
changeset 538 74219eadab5e
parent 534 92fb2b0d5117
child 539 6a9bf1852bbc
--- a/hedgewars/uGears.pas	Mon Jun 04 21:29:05 2007 +0000
+++ b/hedgewars/uGears.pas	Wed Jun 06 21:27:12 2007 +0000
@@ -447,7 +447,7 @@
              Surface);
 
 with PHedgehog(Gear^.Hedgehog)^ do
-     if (Gear^.State and not gstAnimation) = 0 then
+     if (Gear^.State{ and not gstAnimation}) = 0 then
         begin
         t:= hwRound(Gear^.Y) - cHHRadius - 10 + WorldDy;
         dec(t, HealthTag^.h + 2);
@@ -457,6 +457,7 @@
         dec(t, Team^.NameTag^.h + 2);
         DrawCentered(hwRound(Gear^.X) + WorldDx, t, Team^.NameTag, Surface)
         end else // Current hedgehog
+      if (Gear^.State and gstHHDriven) <> 0 then
         begin
         if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
            DrawSprite(sprFinger, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 64 + WorldDy,
@@ -649,7 +650,7 @@
 while Gear <> nil do
       begin
       dmg:= dmgRadius - hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y)));
-      if (dmg > 0) and
+      if (dmg > 1) and
          ((Gear^.State and gstNoDamage) = 0) then
          begin
          dmg:= dmg div 2;
@@ -698,7 +699,7 @@
 while t <> nil do
     begin
     dmg:= min(Gear^.Radius + t^.Radius - hwRound(Distance(Gear^.X - t^.X, Gear^.Y - t^.Y)), 25);
-    if dmg >= 0 then
+    if dmg > 0 then
        case t^.Kind of
            gtHedgehog,
                gtMine,
@@ -748,11 +749,11 @@
                           AddDamageTag(hwRound(t^.ar[i]^.X), hwRound(t^.ar[i]^.Y), Damage, t^.ar[i]);
                           inc(hh^.DamageGiven, Damage)
                           end;
+                       DeleteCI(t^.ar[i]);
                        t^.ar[i]^.dX:= Ammo^.dX * Power * _0_01;
                        t^.ar[i]^.dY:= Ammo^.dY * Power * _0_01;
                        t^.ar[i]^.Active:= true;
                        t^.ar[i]^.State:= t^.ar[i]^.State or gstMoving;
-                       DeleteCI(t^.ar[i]);
                        FollowGear:= t^.ar[i]
                        end;
            end