merge hedgeroid
authorXeli
Wed, 17 Aug 2011 18:09:25 +0200
branchhedgeroid
changeset 5593 bc37bad14800
parent 5591 c6c94a9a8a82 (current diff)
parent 5590 efd92458c75c (diff)
child 5595 480d451152a5
merge
--- a/hedgewars/uGears.pas	Wed Aug 17 17:15:42 2011 +0200
+++ b/hedgewars/uGears.pas	Wed Aug 17 18:09:25 2011 +0200
@@ -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);