(svn r13664) -Fix [FS#2117]: bus/truck forgetting go-to-depot order when entering a non-drivethrough road stop.
authorrubidium
Mon, 30 Jun 2008 15:13:40 +0000
changeset 11106 f51503265cb2
parent 11105 bbcfdef0958e
child 11107 6db1c5112e97
(svn r13664) -Fix [FS#2117]: bus/truck forgetting go-to-depot order when entering a non-drivethrough road stop.
src/roadveh_cmd.cpp
--- a/src/roadveh_cmd.cpp	Mon Jun 30 14:58:58 2008 +0000
+++ b/src/roadveh_cmd.cpp	Mon Jun 30 15:13:40 2008 +0000
@@ -1719,7 +1719,7 @@
 			v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME))) {
 
 		RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile));
-		Station* st = GetStationByTile(v->tile);
+		Station *st = GetStationByTile(v->tile);
 
 		/* Vehicle is at the stop position (at a bay) in a road stop.
 		 * Note, if vehicle is loading/unloading it has already been handled,
@@ -1754,19 +1754,13 @@
 
 			v->last_station_visited = st->index;
 
-			if (IsDriveThroughStopTile(v->tile) || v->current_order.GetDestination() == st->index) {
+			if (IsDriveThroughStopTile(v->tile) || (v->current_order.IsType(OT_GOTO_STATION) && v->current_order.GetDestination() == st->index)) {
 				RoadVehArrivesAt(v, st);
 				v->BeginLoading();
-			} else {
-				v->current_order.MakeLeaveStation();
-				InvalidateVehicleOrder(v);
+				return false;
 			}
-
-			return false;
-		}
-
-		/* Vehicle is ready to leave a bay in a road stop */
-		if (!v->current_order.IsType(OT_GOTO_DEPOT)) {
+		} else {
+			/* Vehicle is ready to leave a bay in a road stop */
 			if (rs->IsEntranceBusy()) {
 				/* Road stop entrance is busy, so wait as there is nowhere else to go */
 				v->cur_speed = 0;