summaryrefslogtreecommitdiff
path: root/src/ship_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
commitc2dcccae163cf7ae604540528c08fed45dd0dbda (patch)
treeeb86df4a79dffa6270deda722c234ab9cb3c8964 /src/ship_cmd.cpp
parent3a0e647c0eacf9619ad61e8e0c8f59a588886d27 (diff)
downloadopenttd-c2dcccae163cf7ae604540528c08fed45dd0dbda.tar.xz
(svn r11001) -Codechange: unify the way to determine whether a vehicle is in a depot.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r--src/ship_cmd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 29be282e6..5b13a2580 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -152,7 +152,7 @@ static void CheckIfShipNeedsService(Vehicle *v)
if (_patches.gotodepot && VehicleHasDepotOrders(v)) return;
- if (IsShipInDepot(v)) {
+ if (v->IsInDepot()) {
VehicleServiceInDepot(v);
return;
}
@@ -355,7 +355,7 @@ static void CheckShipLeaveDepot(Vehicle *v)
Axis axis;
uint m;
- if (!IsShipInDepot(v)) return;
+ if (!v->IsInDepot()) return;
tile = v->tile;
axis = GetShipDepotAxis(tile);
@@ -678,7 +678,7 @@ static void ShipController(Vehicle *v)
GetNewVehiclePosResult gp = GetNewVehiclePos(v);
if (gp.old_tile == gp.new_tile) {
/* Staying in tile */
- if (IsShipInDepot(v)) {
+ if (v->IsInDepot()) {
gp.x = v->x_pos;
gp.y = v->y_pos;
} else {
@@ -925,7 +925,7 @@ CommandCost CmdSellShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
- if (!IsShipInDepotStopped(v)) {
+ if (!v->IsStoppedInDepot()) {
return_cmd_error(STR_980B_SHIP_MUST_BE_STOPPED_IN);
}
@@ -967,7 +967,7 @@ CommandCost CmdStartStopShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
}
if (flags & DC_EXEC) {
- if (IsShipInDepotStopped(v)) {
+ if (v->IsStoppedInDepot()) {
DeleteVehicleNews(p1, STR_981C_SHIP_IS_WAITING_IN_DEPOT);
}
@@ -1007,7 +1007,7 @@ CommandCost CmdSendShipToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p
if (v->vehstatus & VS_CRASHED) return CMD_ERROR;
- if (IsShipInDepot(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) {
@@ -1079,7 +1079,7 @@ CommandCost CmdRefitShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (v->type != VEH_SHIP || !CheckOwnership(v->owner)) return CMD_ERROR;
- if (!IsShipInDepotStopped(v)) {
+ if (!v->IsStoppedInDepot()) {
return_cmd_error(STR_980B_SHIP_MUST_BE_STOPPED_IN);
}