summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-05 14:54:23 +0000
committertron <tron@openttd.org>2006-06-05 14:54:23 +0000
commit028e5ad512a0401d8b4ee92964e715604c714104 (patch)
tree5fc6be4bb4227b1ef74a48fb47cfb045a2666b03
parent098e54f7d9905b5d33f0e13a9a9d6209d5dfea50 (diff)
downloadopenttd-028e5ad512a0401d8b4ee92964e715604c714104.tar.xz
(svn r5127) Use IsRoadVehInDepotStopped() and IsAircraftInHangarStopped()
-rw-r--r--ai/default/default.c10
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;