diff src/roadveh_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 a24293df92f5
children 09743324277c
line wrap: on
line diff
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -304,7 +304,7 @@
 	}
 
 	if (flags & DC_EXEC) {
-		if (IsRoadVehInDepotStopped(v)) {
+		if (v->IsStoppedInDepot()) {
 			DeleteVehicleNews(p1, STR_9016_ROAD_VEHICLE_IS_WAITING);
 		}
 
@@ -469,7 +469,7 @@
 
 	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 @@
 			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 @@
 
 	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 @@
 	/* 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 @@
 
 	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 @@
 	/* 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;
 	}