summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-29 21:49:08 +0000
committerrubidium <rubidium@openttd.org>2007-08-29 21:49:08 +0000
commita407d53d1b2a329a5ae747ea83d4652427cc6c8a (patch)
treeeb86df4a79dffa6270deda722c234ab9cb3c8964 /src/roadveh_cmd.cpp
parenta28d33b5dc89e47ae271b5dbdcc4f5e6f1784c6c (diff)
downloadopenttd-a407d53d1b2a329a5ae747ea83d4652427cc6c8a.tar.xz
(svn r11001) -Codechange: unify the way to determine whether a vehicle is in a depot.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 82a02305a..d24de2980 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -304,7 +304,7 @@ CommandCost CmdStartStopRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32
}
if (flags & DC_EXEC) {
- if (IsRoadVehInDepotStopped(v)) {
+ if (v->IsStoppedInDepot()) {
DeleteVehicleNews(p1, STR_9016_ROAD_VEHICLE_IS_WAITING);
}
@@ -469,7 +469,7 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint3
if (v->vehstatus & VS_CRASHED) return CMD_ERROR;
- if (IsRoadVehInDepot(v)) return CMD_ERROR;
+ if (v->IsInDepot()) return CMD_ERROR;
/* If the current orders are already goto-depot */
if (v->current_order.type == OT_GOTO_DEPOT) {
@@ -538,7 +538,7 @@ CommandCost CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
v->breakdown_ctr != 0 ||
v->u.road.overtaking != 0 ||
v->u.road.state == RVSB_WORMHOLE ||
- IsRoadVehInDepot(v) ||
+ v->IsInDepot() ||
v->cur_speed < 5) {
return CMD_ERROR;
}
@@ -865,7 +865,7 @@ static void* EnumCheckRoadVehClose(Vehicle *v, void* data)
return
v->type == VEH_ROAD &&
- !IsRoadVehInDepot(v) &&
+ !v->IsInDepot() &&
myabs(v->z_pos - rvf->veh->z_pos) < 6 &&
v->direction == rvf->dir &&
GetFirstVehicleInChain(rvf->veh) != GetFirstVehicleInChain(v) &&
@@ -1439,7 +1439,7 @@ static bool IndividualRoadVehicleController(Vehicle *v, const Vehicle *prev)
/* If this vehicle is in a depot and we've reached this point it must be
* one of the articulated parts. It will stay in the depot until activated
* by the previous vehicle in the chain when it gets to the right place. */
- if (IsRoadVehInDepot(v)) return true;
+ if (v->IsInDepot()) return true;
/* Save old vehicle position to use at end of move to set viewport area dirty */
BeginVehicleMove(v);
@@ -1817,7 +1817,7 @@ static void RoadVehController(Vehicle *v)
if (v->current_order.type == OT_LOADING) return;
- if (IsRoadVehInDepot(v) && RoadVehLeaveDepot(v, true)) return;
+ if (v->IsInDepot() && RoadVehLeaveDepot(v, true)) return;
/* Check if vehicle needs to proceed, return if it doesn't */
if (!RoadVehAccelerate(v)) return;
@@ -1858,7 +1858,7 @@ static void CheckIfRoadVehNeedsService(Vehicle *v)
/* If we already got a slot at a stop, use that FIRST, and go to a depot later */
if (v->u.road.slot != NULL) return;
- if (IsRoadVehInDepot(v)) {
+ if (v->IsInDepot()) {
VehicleServiceInDepot(v);
return;
}