Remove PosInStack function, as bots behave better (they search more positions) without it
authorunc0rr
Fri, 19 Aug 2011 15:41:04 +0400
changeset 5600 c6da15eddab3
parent 5598 265429f7ba85
child 5602 c89b81817ee4
Remove PosInStack function, as bots behave better (they search more positions) without it
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Fri Aug 19 06:08:06 2011 +0200
+++ b/hedgewars/uAI.pas	Fri Aug 19 15:41:04 2011 +0400
@@ -171,21 +171,6 @@
          end
     end;
 
-    function PosInThinkStack(Me: PGear): boolean;
-    var i: Longword;
-    begin
-    i:= 0;
-    while (i < Stack.Count) do
-          begin
-          if(not(hwAbs(Stack.States[i].Hedgehog.X - Me^.X) +
-                 hwAbs(Stack.States[i].Hedgehog.Y - Me^.Y) > _2)) and
-              (Stack.States[i].Hedgehog.Message = Me^.Message) then exit(true);
-          inc(i)
-          end;
-    PosInThinkStack:= false
-    end;
-
-
 var Actions: TActions;
     ticks, maxticks, steps, tmp: Longword;
     BaseRate, BestRate, Rate: integer;
@@ -224,7 +209,7 @@
                                       else AddAction(Actions, aia_WaitXR, hwRound(Me^.X), 0, 0, 0);
     steps:= 0;
 
-    while (not StopThinking) and (not PosInThinkStack(Me)) do
+    while (not StopThinking) do
        begin
 {$HINTS OFF}
        CanGo:= HHGo(Me, @AltMe, GoInfo);