src/ai/ai_threads.cpp
branchnoai
changeset 9496 05ebee9884b3
parent 9450 d675836e865c
child 9514 e31710af1ca0
equal deleted inserted replaced
9495:29284ad4ae39 9496:05ebee9884b3
     9 #include "../debug.h"
     9 #include "../debug.h"
    10 #include "../thread.h"
    10 #include "../thread.h"
    11 #include "ai.h"
    11 #include "ai.h"
    12 #include "ai_threads.h"
    12 #include "ai_threads.h"
    13 #include "api/ai_controller.hpp"
    13 #include "api/ai_controller.hpp"
       
    14 #include "api/ai_object.hpp"
    14 
    15 
    15 #include <pthread.h>
    16 #include <pthread.h>
    16 
    17 
    17 /** The overall state of an AI threading wise */
    18 /** The overall state of an AI threading wise */
    18 class AIThreadState {
    19 class AIThreadState {
   262  */
   263  */
   263 void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2)
   264 void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2)
   264 {
   265 {
   265 	/* Store if we were a success or not and resume */
   266 	/* Store if we were a success or not and resume */
   266 	_ai_state[_current_player].last_command_res = success;
   267 	_ai_state[_current_player].last_command_res = success;
       
   268 
       
   269 	/* Store some values inside the AIObject static memory */
       
   270 	AIObject::SetNewVehicleID(_new_vehicle_id);
       
   271 
   267 	_ai_state[_current_player].Resume();
   272 	_ai_state[_current_player].Resume();
   268 }
   273 }
   269 
   274 
   270 /**
   275 /**
   271  * Returns the result of the last command which was received by the
   276  * Returns the result of the last command which was received by the