hedgewars/uGearsUtils.pas
changeset 7627 e1e112687fd6
parent 7625 5c0ad64afc8d
child 7719 eeae1cb6b6bf
--- a/hedgewars/uGearsUtils.pas	Wed Aug 29 20:07:17 2012 +0200
+++ b/hedgewars/uGearsUtils.pas	Wed Aug 29 23:12:47 2012 -0400
@@ -142,7 +142,7 @@
 // Run the calcs only once we know we have a type that will need damage
                         tdX:= Gear^.X-fX;
                         tdY:= Gear^.Y-fY;
-                        if hwRound(hwAbs(tdX)+hwAbs(tdY)) < dmgBase then
+                        if (tdX.Round + tdY.Round + 2) < dmgBase then
                             dmg:= dmgBase - hwRound(Distance(tdX, tdY));
                         if dmg > 1 then
                             begin
@@ -241,9 +241,7 @@
         end;
     end
     else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure
-        begin
         Gear^.Hedgehog:= AttackerHog;
-        end;
     inc(Gear^.Damage, Damage);
     
     ScriptCall('onGearDamage', Gear^.UID, Damage);