hedgewars/uAIMisc.pas
changeset 7279 18a620394623
parent 7274 a07777b818f1
child 7285 a9016b157535
--- a/hedgewars/uAIMisc.pas	Sun Jun 24 13:18:33 2012 -0400
+++ b/hedgewars/uAIMisc.pas	Sun Jun 24 22:37:44 2012 +0400
@@ -534,17 +534,17 @@
 
 for i:= 0 to Pred(Targets.Count) do
     with Targets.ar[i] do
-        begin
          // hammer hit radius is 8, shift is 10
         if abs(Point.x - x) + abs(Point.y - y) < 18 then
+            begin
             r:= trunc(sqrt(sqr(Point.x - x)+sqr(Point.y - y)));
 
-        if r <= 18 then
-            if Score > 0 then 
-                inc(rate, Score div 3)
-            else 
-                inc(rate, Score div 3 * friendlyfactor div 100)
-        end;
+            if r <= 18 then
+                if Score > 0 then 
+                    inc(rate, Score div 3)
+                else
+                    dec(rate, Score div 3 * friendlyfactor div 100)
+            end;
 RateHammer:= rate * 1024;
 end;