src/ai/trolly/trolly.cpp
changeset 8064 fef5cd447a5a
parent 7763 342e5357b592
child 8108 b42a0e5c67ef
equal deleted inserted replaced
8063:d3fa4e88f087 8064:fef5cd447a5a
    35 #include "../../gui.h"
    35 #include "../../gui.h"
    36 #include "../../depot.h"
    36 #include "../../depot.h"
    37 #include "../../vehicle.h"
    37 #include "../../vehicle.h"
    38 #include "../../date.h"
    38 #include "../../date.h"
    39 #include "../ai.h"
    39 #include "../ai.h"
       
    40 #include "../../order.h"
    40 
    41 
    41 // This function is called after StartUp. It is the init of an AI
    42 // This function is called after StartUp. It is the init of an AI
    42 static void AiNew_State_FirstTime(Player *p)
    43 static void AiNew_State_FirstTime(Player *p)
    43 {
    44 {
    44 	// This assert is used to protect those function from misuse
    45 	// This assert is used to protect those function from misuse
  1169 	Order order;
  1170 	Order order;
  1170 
  1171 
  1171 	assert(p->ainew.state == AI_STATE_GIVE_ORDERS);
  1172 	assert(p->ainew.state == AI_STATE_GIVE_ORDERS);
  1172 
  1173 
  1173 	if (p->ainew.veh_main_id != INVALID_VEHICLE) {
  1174 	if (p->ainew.veh_main_id != INVALID_VEHICLE) {
  1174 		AI_DoCommand(0, p->ainew.veh_id + (p->ainew.veh_main_id << 16), 0, DC_EXEC, CMD_CLONE_ORDER);
  1175 		AI_DoCommand(0, p->ainew.veh_id + (p->ainew.veh_main_id << 16), CO_SHARE, DC_EXEC, CMD_CLONE_ORDER);
  1175 
  1176 
  1176 		p->ainew.state = AI_STATE_START_VEHICLE;
  1177 		p->ainew.state = AI_STATE_START_VEHICLE;
  1177 		return;
  1178 		return;
  1178 	} else {
  1179 	} else {
  1179 		p->ainew.veh_main_id = p->ainew.veh_id;
  1180 		p->ainew.veh_main_id = p->ainew.veh_id;