...
authornemo
Wed, 17 Aug 2011 11:17:50 -0400
changeset 5590 efd92458c75c
parent 5588 cf643996c1ee
child 5592 662ebb46642f
child 5593 bc37bad14800
...
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Wed Aug 17 11:07:03 2011 -0400
+++ b/hedgewars/uGears.pas	Wed Aug 17 11:17:50 2011 -0400
@@ -1351,12 +1351,13 @@
             gtExplosives,
             gtStructure: begin
 //addFileLog('ShotgunShot radius: ' + inttostr(Gear^.Radius) + ', t^.Radius = ' + inttostr(t^.Radius) + ', distance = ' + inttostr(dist) + ', dmg = ' + inttostr(dmg));
+                    dmg:= 0;
                     r:= Gear^.Radius + t^.Radius;
                     dx:= Gear^.X-t^.X;
                     dx.isNegative:= false;
                     dy:= Gear^.Y-t^.Y;
                     dy.isNegative:= false;
-                    if hwRound(dx+dy) < 25+r then
+                    if r-hwRound(dx+dy) > 0 then
                         begin
                         dist:= hwRound(Distance(dx, dy));
                         dmg:= ModifyDamage(min(r - dist, 25), t);
@@ -1377,12 +1378,13 @@
                         end
                     end;
             gtGrave: begin
+                    dmg:= 0;
                     r:= Gear^.Radius + t^.Radius;
                     dx:= Gear^.X-t^.X;
                     dx.isNegative:= false;
                     dy:= Gear^.Y-t^.Y;
                     dy.isNegative:= false;
-                    if hwRound(dx+dy) < 25+r then
+                    if r-hwRound(dx+dy) > 0 then
                         begin
                         dist:= hwRound(Distance(dx, dy));
                         dmg:= ModifyDamage(min(r - dist, 25), t);