hedgewars/uAI.pas
changeset 7026 8d1724e1337e
parent 6992 b8f3d8991e92
child 7028 0f60591f3a16
equal deleted inserted replaced
7025:831a25c74c7b 7026:8d1724e1337e
    43 {$ENDIF}
    43 {$ENDIF}
    44     hasThread: LongInt;
    44     hasThread: LongInt;
    45 
    45 
    46 procedure FreeActionsList;
    46 procedure FreeActionsList;
    47 begin
    47 begin
    48 AddFileLog('FreeActionsList called');
    48     AddFileLog('FreeActionsList called');
    49 if hasThread <> 0 then
    49     if hasThread <> 0 then
    50     begin
    50     begin
    51     AddFileLog('Waiting AI thread to finish');
    51         AddFileLog('Waiting AI thread to finish');
    52     StopThinking:= true;
    52         StopThinking:= true;
    53     repeat
    53         repeat
    54         SDL_Delay(10)
    54             SDL_Delay(10)
    55     until hasThread = 0
    55         until hasThread = 0
    56     end;
    56     end;
    57 
    57 
    58 with CurrentHedgehog^ do
    58     with CurrentHedgehog^ do
    59     if Gear <> nil then
    59         if Gear <> nil then
    60         if BotLevel <> 0 then
    60             if BotLevel <> 0 then
    61             StopMessages(Gear^.Message);
    61                 StopMessages(Gear^.Message);
    62 
    62 
    63 BestActions.Count:= 0;
    63     BestActions.Count:= 0;
    64 BestActions.Pos:= 0
    64     BestActions.Pos:= 0
    65 end;
    65 end;
    66 
    66 
    67 
    67 
    68 
    68 
    69 const cBranchStackSize = 12;
    69 const cBranchStackSize = 12;
   443     ThinkThread:= ThinkThread;
   443     ThinkThread:= ThinkThread;
   444 end;
   444 end;
   445 
   445 
   446 procedure freeModule;
   446 procedure freeModule;
   447 begin
   447 begin
   448 
   448     FreeActionsList();
   449 end;
   449 end;
   450 
   450 
   451 end.
   451 end.