diff src/ship_cmd.cpp @ 7490:f538c635385c draft

(svn r11001) -Codechange: unify the way to determine whether a vehicle is in a depot.
author rubidium <rubidium@openttd.org>
date Wed, 29 Aug 2007 21:49:08 +0000 (2007-08-29)
parents d2dde99b2258
children 2250b8ea9466
line wrap: on
line diff
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -152,7 +152,7 @@
 
 	if (_patches.gotodepot && VehicleHasDepotOrders(v)) return;
 
-	if (IsShipInDepot(v)) {
+	if (v->IsInDepot()) {
 		VehicleServiceInDepot(v);
 		return;
 	}
@@ -355,7 +355,7 @@
 	Axis axis;
 	uint m;
 
-	if (!IsShipInDepot(v)) return;
+	if (!v->IsInDepot()) return;
 
 	tile = v->tile;
 	axis = GetShipDepotAxis(tile);
@@ -678,7 +678,7 @@
 	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 @@
 
 	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 @@
 	}
 
 	if (flags & DC_EXEC) {
-		if (IsShipInDepotStopped(v)) {
+		if (v->IsStoppedInDepot()) {
 			DeleteVehicleNews(p1, STR_981C_SHIP_IS_WAITING_IN_DEPOT);
 		}
 
@@ -1007,7 +1007,7 @@
 
 	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 @@
 
 	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);
 	}