# HG changeset patch # User unc0rr # Date 1310027647 -14400 # Node ID 4a0a8f32b7e352786811560a39363c43c5489108 # Parent 924584407e01768c2deb236dabe74158b12515f2 This seems to be a much better place diff -r 924584407e01 -r 4a0a8f32b7e3 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Tue Jul 05 21:41:48 2011 +0400 +++ b/hedgewars/uAI.pas Thu Jul 07 12:34:07 2011 +0400 @@ -74,6 +74,9 @@ with CurrentHedgehog^ do a:= CurAmmoType; aa:= a; + + ThreadSwitch(); + repeat if (CanUseAmmo[a]) and ((not isMoved) or ((AmmoTests[a].flags and amtest_OnTurn) = 0)) then @@ -262,8 +265,6 @@ Push(ticks, Actions, Me^, Me^.Message xor 3); // aia_Left xor 3 = aia_Right end; - ThreadSwitch(); - if BestRate > BaseRate then exit end end; @@ -284,7 +285,6 @@ if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(1000); if BestActions.Score < -1023 then begin - addfilelog('AI: best score ' + inttostr(bestactions.score)); BestActions.Count:= 0; AddAction(BestActions, aia_Skip, 0, 250, 0, 0); end;