Avoid local rate minimums around hog (within 15 pixels). Not tested.
authorunc0rr
Mon, 12 Mar 2012 23:46:28 +0400
changeset 6777 fb71556205f4
parent 6776 7a05f48bfa43
child 6778 a9c6457dca29
Avoid local rate minimums around hog (within 15 pixels). Not tested.
hedgewars/uAIMisc.pas
--- a/hedgewars/uAIMisc.pas	Mon Mar 12 16:08:40 2012 +0400
+++ b/hedgewars/uAIMisc.pas	Mon Mar 12 23:46:28 2012 +0400
@@ -195,8 +195,10 @@
     with bonuses.ar[i] do
         begin
         r:= hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y)));
-        if r < Radius then
-            inc(rate, Score * (Radius - r))
+        if r < 15 then
+                inc(rate, Score * Radius)
+        else if r < Radius then
+                inc(rate, Score * (Radius - r))
         end;
     RatePlace:= rate;
 end;