diff options
author | tron <tron@openttd.org> | 2006-06-05 14:54:23 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-06-05 14:54:23 +0000 |
commit | 6b37bda99734b21a495f9fc0c7bc49e24075ea87 (patch) | |
tree | 5fc6be4bb4227b1ef74a48fb47cfb045a2666b03 /ai/default | |
parent | 00aa407edd3e6c85b7bc667cfd7a1a70d65c4f28 (diff) | |
download | openttd-6b37bda99734b21a495f9fc0c7bc49e24075ea87.tar.xz |
(svn r5127) Use IsRoadVehInDepotStopped() and IsAircraftInHangarStopped()
Diffstat (limited to 'ai/default')
-rw-r--r-- | ai/default/default.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ai/default/default.c b/ai/default/default.c index 8ccb375a2..3287bf442 100644 --- a/ai/default/default.c +++ b/ai/default/default.c @@ -2,11 +2,13 @@ #include "../../stdafx.h" #include "../../openttd.h" +#include "../../aircraft.h" #include "../../bridge_map.h" #include "../../functions.h" #include "../../map.h" #include "../../rail_map.h" #include "../../road_map.h" +#include "../../roadveh.h" #include "../../station_map.h" #include "../../tile.h" #include "../../player.h" @@ -331,7 +333,7 @@ static void AiHandleReplaceRoadVeh(Player *p) BackuppedOrders orderbak[1]; EngineID veh; - if (!IsTileDepotType(v->tile, TRANSPORT_ROAD) || v->u.road.state != 254 || !(v->vehstatus&VS_STOPPED)) { + if (!IsRoadVehInDepotStopped(v)) { AiHandleGotoDepot(p, CMD_SEND_ROADVEH_TO_DEPOT); return; } @@ -360,7 +362,7 @@ static void AiHandleReplaceAircraft(Player *p) BackuppedOrders orderbak[1]; EngineID veh; - if (!IsHangarTile(v->tile) || !(v->vehstatus & VS_STOPPED)) { + if (!IsAircraftInHangarStopped(v)) { AiHandleGotoDepot(p, CMD_SEND_AIRCRAFT_TO_HANGAR); return; } @@ -3516,7 +3518,7 @@ static void AiStateSellVeh(Player *p) DoCommand(v->tile, v->index, 1, DC_EXEC, CMD_SELL_RAIL_WAGON); } else if (v->type == VEH_Road) { - if (!IsTileDepotType(v->tile, TRANSPORT_ROAD) || v->u.road.state != 254 || !(v->vehstatus&VS_STOPPED)) { + if (!IsRoadVehInDepotStopped(v)) { if (v->current_order.type != OT_GOTO_DEPOT) DoCommand(0, v->index, 0, DC_EXEC, CMD_SEND_ROADVEH_TO_DEPOT); goto going_to_depot; @@ -3524,7 +3526,7 @@ static void AiStateSellVeh(Player *p) DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_ROAD_VEH); } else if (v->type == VEH_Aircraft) { - if (!IsHangarTile(v->tile) || !(v->vehstatus & VS_STOPPED)) { + if (!IsAircraftInHangarStopped(v)) { if (v->current_order.type != OT_GOTO_DEPOT) DoCommand(0, v->index, 0, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR); goto going_to_depot; |