# HG changeset patch # User unc0rr # Date 1313754064 -14400 # Node ID c6da15eddab3f7fc6e575bbeff755e3fb28cce6d # Parent 265429f7ba8595c1e73d7e99254c1832600f6215 Remove PosInStack function, as bots behave better (they search more positions) without it diff -r 265429f7ba85 -r c6da15eddab3 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);