(svn r13690) [0.6] -Backport from trunk: 0.6
authorrubidium
Wed, 09 Jul 2008 19:39:57 +0000
branch0.6
changeset 11132 6dd6907c378d
parent 11131 d8136dad6b1c
child 11150 4e3726a46a72
(svn r13690) [0.6] -Backport from trunk:
- Fix: Bus/truck forgetting go-to-depot order when entering a non-drivethrough road stop [FS#2117] (r13664)
- Fix: Only the front of a RV would be considered when determining to what cargos a vehicle can be refitted instead of all cargos [FS#2109] (r13622)
- Fix: RVs continueing onto next DT station when they are build adjacent to them [FS#2040] (r13581)
changelog.txt
src/roadveh_cmd.cpp
src/roadveh_gui.cpp
src/vehicle_gui.cpp
--- a/changelog.txt	Wed Jul 09 19:30:44 2008 +0000
+++ b/changelog.txt	Wed Jul 09 19:39:57 2008 +0000
@@ -23,7 +23,6 @@
 - Fix: First determine where to *exactly* build a house before asking a NewGRF whether the location is good instead of possibly moving the house a tile after the NewGRF said the location is good (r13489)
 - Fix: Track was not removed on company bankrupcy when there was a ship on lower halftile (r13488)
 - Fix: Let ships also navigate on half-tile sloped watery rail tiles (r13485)
-- Fix: Road vehicles stoppping at drive through stations of other companies [FS#2050] (r13480)
 - Fix: Division by zero when one would press 'd' (skip order) when there's no order (r13409)
 - Fix: Do not crash when resolving vehicle sprite groups with zero sprites (r13397)
 - Fix: In the purchase list, CB36 for capacity was not called for the first part of rail and road vehicles (r13385)
--- a/src/roadveh_cmd.cpp	Wed Jul 09 19:30:44 2008 +0000
+++ b/src/roadveh_cmd.cpp	Wed Jul 09 19:39:57 2008 +0000
@@ -1814,13 +1814,12 @@
 			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,
 		 * so if we get here the vehicle has just arrived or is just ready to leave. */
-		if (v->current_order.type != OT_LEAVESTATION &&
-				v->current_order.type != OT_GOTO_DEPOT) {
+		if (v->current_order.type != OT_LEAVESTATION) {
 			/* Vehicle has arrived at a bay in a road stop */
 
 			if (IsDriveThroughStopTile(v->tile)) {
@@ -1828,7 +1827,7 @@
 				RoadStop::Type type = IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK;
 
 				/* Check if next inline bay is free */
-				if (IsDriveThroughStopTile(next_tile) && (GetRoadStopType(next_tile) == type)) {
+				if (IsDriveThroughStopTile(next_tile) && (GetRoadStopType(next_tile) == type) && GetStationIndex(v->tile) == GetStationIndex(next_tile)) {
 					RoadStop *rs_n = GetRoadStopByTile(next_tile, type);
 
 					if (rs_n->IsFreeBay(HasBit(v->u.road.state, RVS_USING_SECOND_BAY))) {
@@ -1850,14 +1849,13 @@
 
 			v->last_station_visited = GetStationIndex(v->tile);
 
-			RoadVehArrivesAt(v, st);
-			v->BeginLoading();
-
-			return false;
-		}
-
-		/* Vehicle is ready to leave a bay in a road stop */
-		if (v->current_order.type != OT_GOTO_DEPOT) {
+			if (IsDriveThroughStopTile(v->tile) || (v->current_order.type == OT_GOTO_STATION && v->current_order.dest == st->index)) {
+				RoadVehArrivesAt(v, st);
+				v->BeginLoading();
+				return false;
+			}
+		} 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;
--- a/src/roadveh_gui.cpp	Wed Jul 09 19:30:44 2008 +0000
+++ b/src/roadveh_gui.cpp	Wed Jul 09 19:39:57 2008 +0000
@@ -23,7 +23,7 @@
 
 void DrawRoadVehDetails(const Vehicle *v, int x, int y)
 {
-	uint y_offset = RoadVehHasArticPart(v) ? 15 :0;
+	uint y_offset = RoadVehHasArticPart(v) ? 15 : 0;
 	StringID str;
 
 	SetDParam(0, v->engine_type);
@@ -62,6 +62,8 @@
 		DrawStringTruncated(x, y + 10 + y_offset, STR_JUST_STRING, TC_BLUE, 380 - x);
 
 		for (const Vehicle *u = v; u != NULL; u = u->Next()) {
+			if (u->cargo_cap == 0) continue;
+
 			str = STR_8812_EMPTY;
 			if (!u->cargo.Empty()) {
 				SetDParam(0, u->cargo_type);
--- a/src/vehicle_gui.cpp	Wed Jul 09 19:30:44 2008 +0000
+++ b/src/vehicle_gui.cpp	Wed Jul 09 19:39:57 2008 +0000
@@ -275,7 +275,7 @@
 				}
 			}
 		}
-	} while (v->type == VEH_TRAIN && (u = u->Next()) != NULL && num_lines < max_lines);
+	} while ((v->type == VEH_TRAIN || v->type == VEH_ROAD) && (u = u->Next()) != NULL && num_lines < max_lines);
 
 	list->num_lines = num_lines;
 	list->items = refit;
@@ -1378,7 +1378,7 @@
 
 			/* Add space for the cargo amount for each part. */
 			for (const Vehicle *u = v; u != NULL; u = u->Next()) {
-				height_extension += 11;
+				if (u->cargo_cap != 0) height_extension += 11;
 			}
 
 			ResizeWindow(w, 0, height_extension);