tiny (probably) optimisation
authornemo
Wed, 29 Aug 2012 11:48:10 -0400
changeset 7625 5c0ad64afc8d
parent 7624 03d662ff9c41
child 7626 73b9a385f898
tiny (probably) optimisation
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsUtils.pas	Wed Aug 29 10:56:32 2012 -0400
+++ b/hedgewars/uGearsUtils.pas	Wed Aug 29 11:48:10 2012 -0400
@@ -108,7 +108,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