# HG changeset patch # User nemo # Date 1346255290 14400 # Node ID 5c0ad64afc8d44fffc5c452932286072cf018539 # Parent 03d662ff9c413c045dabf8e808552733f6dc4b1f tiny (probably) optimisation diff -r 03d662ff9c41 -r 5c0ad64afc8d 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