hedgewars/uAI.pas
changeset 741 8bf8c0ac8d94
parent 740 5ac69a012b69
child 791 928d2830fd0c
equal deleted inserted replaced
740:5ac69a012b69 741:8bf8c0ac8d94
   323         and (TurnTimeLeft < cHedgehogTurnTime - 50) then
   323         and (TurnTimeLeft < cHedgehogTurnTime - 50) then
   324         if ((Gear^.State and gstHHThinking) = 0) then
   324         if ((Gear^.State and gstHHThinking) = 0) then
   325            if (BestActions.Pos >= BestActions.Count)
   325            if (BestActions.Pos >= BestActions.Count)
   326               and (TurnTimeLeft > cStopThinkTime) then
   326               and (TurnTimeLeft > cStopThinkTime) then
   327               begin
   327               begin
   328               TryDo((Gear^.Message = 0) and (gameType <> gmtSave), 'Engine bug: AI may break demos playing', true);
   328               TryDo(Gear^.Message = 0, 'Engine bug: AI may break demos playing', true);
   329               StartThink(Gear);
   329               StartThink(Gear);
   330               StartTicks:= GameTicks
   330               StartTicks:= GameTicks
   331               end else ProcessAction(BestActions, Gear)
   331               end else ProcessAction(BestActions, Gear)
   332         else if ((GameTicks - StartTicks) > cMaxAIThinkTime)
   332         else if ((GameTicks - StartTicks) > cMaxAIThinkTime)
   333                 or (TurnTimeLeft <= cStopThinkTime) then StopThinking:= true
   333                 or (TurnTimeLeft <= cStopThinkTime) then StopThinking:= true