hedgewars/uAIMisc.pas
changeset 1141 44d4d6aaecb5
parent 1066 1f1b3686a2b0
child 1352 405ad07cf875
--- a/hedgewars/uAIMisc.pas	Tue Jul 29 22:59:19 2008 +0000
+++ b/hedgewars/uAIMisc.pas	Wed Jul 30 12:14:24 2008 +0000
@@ -193,10 +193,10 @@
 for i:= 0 to Targets.Count do
     with Targets.ar[i] do
          begin
-         dmg:= r - hwRound(DistanceI(Point.x - x, Point.y - y));
+         dmg:= r + cHHRadius div 2 - hwRound(DistanceI(Point.x - x, Point.y - y));
          if dmg > 0 then
             begin
-            dmg:= dmg shr 1;
+            dmg:= min(dmg div 2, r);
             if dmg >= abs(Score) then
                if Score > 0 then inc(Result, KillScore)
                             else dec(Result, KillScore * friendlyfactor div 100)