This seems to be a much better place
authorunc0rr
Thu, 07 Jul 2011 12:34:07 +0400
changeset 5396 4a0a8f32b7e3
parent 5394 924584407e01
child 5398 ba348dd1d340
This seems to be a much better place
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;