equal
deleted
inserted
replaced
6 #include "../openttd.h" |
6 #include "../openttd.h" |
7 #include "../variables.h" |
7 #include "../variables.h" |
8 #include "../debug.h" |
8 #include "../debug.h" |
9 #include "../thread.h" |
9 #include "../thread.h" |
10 #include "../fiber.hpp" |
10 #include "../fiber.hpp" |
11 #include "../vehicle_func.h" |
|
12 #include "../player_func.h" |
11 #include "../player_func.h" |
13 #include "ai.h" |
12 #include "ai.h" |
14 #include "ai_threads.h" |
13 #include "ai_threads.h" |
15 #include "api/ai_controller.hpp" |
14 #include "api/ai_controller.hpp" |
16 #include "api/ai_object.hpp" |
15 #include "api/ai_object.hpp" |
396 DEBUG(ai, 6, "CcAI(%d) from thr %d", _current_player, ThreadObject::CurrentId()); |
395 DEBUG(ai, 6, "CcAI(%d) from thr %d", _current_player, ThreadObject::CurrentId()); |
397 AIFiber *thr = AIFiber::stFind(_current_player); |
396 AIFiber *thr = AIFiber::stFind(_current_player); |
398 assert(thr != NULL); |
397 assert(thr != NULL); |
399 /* Store if we were a success or not */ |
398 /* Store if we were a success or not */ |
400 AIObject::SetLastCommandRes(success); |
399 AIObject::SetLastCommandRes(success); |
401 /* Store some values inside the AIObject static memory */ |
|
402 AIObject::SetNewVehicleID(_new_vehicle_id); |
|
403 |
400 |
404 /* Resume the fiber now */ |
401 /* Resume the fiber now */ |
405 thr->Resume(); |
402 thr->Resume(); |
406 } |
403 } |
407 |
404 |