hedgewars/uGears.pas
changeset 5139 090a8b8d1083
parent 5137 b6140f35735f
child 5179 8d64dcb566ea
--- a/hedgewars/uGears.pas	Mon Apr 11 00:35:53 2011 +0200
+++ b/hedgewars/uGears.pas	Mon Apr 11 01:30:43 2011 +0200
@@ -1242,7 +1242,7 @@
                 gtStructure: begin
 // Run the calcs only once we know we have a type that will need damage
                         if hwRound(hwAbs(Gear^.X-fX)+hwAbs(Gear^.Y-fY)) < dmgBase then
-                            dmg:= dmgBase - hwRound(Distance(Gear^.X - fX, Gear^.Y - fY));
+                            dmg:= dmgBase - max(hwRound(Distance(Gear^.X - fX, Gear^.Y - fY)),Gear^.Radius);
                         if dmg > 1 then
                             begin
                             dmg:= ModifyDamage(min(dmg div 2, Radius), Gear);