src/ai/default/default.cpp
changeset 8302 ed068d41cf1e
parent 8270 e7c342f6b14c
child 8322 916ef2361569
equal deleted inserted replaced
8301:9f8d82ea6667 8302:ed068d41cf1e
  2514 
  2514 
  2515 		order.type = OT_GOTO_STATION;
  2515 		order.type = OT_GOTO_STATION;
  2516 		order.flags = 0;
  2516 		order.flags = 0;
  2517 		order.dest = AiGetStationIdByDef(aib->use_tile, aib->cur_building_rule);
  2517 		order.dest = AiGetStationIdByDef(aib->use_tile, aib->cur_building_rule);
  2518 
  2518 
  2519 		if (!is_pass && i == 1) order.flags |= OF_UNLOAD;
  2519 		if (!is_pass && i == 1) order.flags |= OFB_UNLOAD;
  2520 		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
  2520 		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
  2521 			order.flags |= OF_FULL_LOAD;
  2521 			order.flags |= OFB_FULL_LOAD;
  2522 
  2522 
  2523 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
  2523 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
  2524 	}
  2524 	}
  2525 
  2525 
  2526 	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_TRAIN);
  2526 	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_TRAIN);
  3256 
  3256 
  3257 		order.type = OT_GOTO_STATION;
  3257 		order.type = OT_GOTO_STATION;
  3258 		order.flags = 0;
  3258 		order.flags = 0;
  3259 		order.dest = AiGetStationIdFromRoadBlock(aib->use_tile, aib->cur_building_rule);
  3259 		order.dest = AiGetStationIdFromRoadBlock(aib->use_tile, aib->cur_building_rule);
  3260 
  3260 
  3261 		if (!is_pass && i == 1) order.flags |= OF_UNLOAD;
  3261 		if (!is_pass && i == 1) order.flags |= OFB_UNLOAD;
  3262 		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
  3262 		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
  3263 			order.flags |= OF_FULL_LOAD;
  3263 			order.flags |= OFB_FULL_LOAD;
  3264 
  3264 
  3265 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
  3265 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
  3266 	}
  3266 	}
  3267 
  3267 
  3268 	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
  3268 	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_ROADVEH);
  3524 
  3524 
  3525 		order.type = OT_GOTO_STATION;
  3525 		order.type = OT_GOTO_STATION;
  3526 		order.flags = 0;
  3526 		order.flags = 0;
  3527 		order.dest = AiGetStationIdFromAircraftBlock(aib->use_tile, aib->cur_building_rule);
  3527 		order.dest = AiGetStationIdFromAircraftBlock(aib->use_tile, aib->cur_building_rule);
  3528 
  3528 
  3529 		if (!is_pass && i == 1) order.flags |= OF_UNLOAD;
  3529 		if (!is_pass && i == 1) order.flags |= OFB_UNLOAD;
  3530 		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
  3530 		if (_players_ai[p->index].num_want_fullload != 0 && (is_pass || i == 0))
  3531 			order.flags |= OF_FULL_LOAD;
  3531 			order.flags |= OFB_FULL_LOAD;
  3532 
  3532 
  3533 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
  3533 		DoCommand(0, loco_id + (i << 16), PackOrder(&order), DC_EXEC, CMD_INSERT_ORDER);
  3534 	}
  3534 	}
  3535 
  3535 
  3536 	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_AIRCRAFT);
  3536 	DoCommand(0, loco_id, 0, DC_EXEC, CMD_START_STOP_AIRCRAFT);