Fix completely broken RateHammer
authorunc0rr
Sun, 24 Jun 2012 22:37:44 +0400
changeset 7279 18a620394623
parent 7277 b817a478dcfb
child 7281 c22dd112c958
Fix completely broken RateHammer
hedgewars/uAIMisc.pas
--- 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;