src/roadveh_cmd.cpp
changeset 7986 881998b115c2
parent 7972 dff055fff851
child 7988 6075538f6111
--- a/src/roadveh_cmd.cpp	Wed Aug 29 21:30:03 2007 +0000
+++ b/src/roadveh_cmd.cpp	Wed Aug 29 21:49:08 2007 +0000
@@ -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;
 	}