This should improve performance on singlecore computers
authorunc0rr
Tue, 05 Jul 2011 21:41:48 +0400
changeset 5394 924584407e01
parent 5392 1840da0c1f1d
child 5396 4a0a8f32b7e3
This should improve performance on singlecore computers
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Mon Jul 04 15:35:44 2011 +0200
+++ b/hedgewars/uAI.pas	Tue Jul 05 21:41:48 2011 +0400
@@ -262,6 +262,8 @@
           Push(ticks, Actions, Me^, Me^.Message xor 3); // aia_Left xor 3 = aia_Right
        end;
 
+    ThreadSwitch();
+
     if BestRate > BaseRate then exit
     end
 end;
@@ -279,7 +281,7 @@
       begin
       WalkMe:= BackMe;
       Walk(@WalkMe);
-      if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(2000);
+      if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(1000);
       if BestActions.Score < -1023 then
          begin
          addfilelog('AI: best score ' + inttostr(bestactions.score));