hedgewars/uAI.pas
changeset 676 2aa3082937ac
parent 602 f7628ebfccde
child 740 5ac69a012b69
equal deleted inserted replaced
675:28e294a496cb 676:2aa3082937ac
   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, 'Engine bug: AI may break demos playing', true);
   328               StartThink(Gear);
   329               StartThink(Gear);
   329               StartTicks:= GameTicks
   330               StartTicks:= GameTicks
   330               end else ProcessAction(BestActions, Gear)
   331               end else ProcessAction(BestActions, Gear)
   331         else if ((GameTicks - StartTicks) > cMaxAIThinkTime)
   332         else if ((GameTicks - StartTicks) > cMaxAIThinkTime)
   332                 or (TurnTimeLeft <= cStopThinkTime) then StopThinking:= true
   333                 or (TurnTimeLeft <= cStopThinkTime) then StopThinking:= true