changeset 4445:a65661ff31c2 draft

(svn r6223) -Fix: RVs with empty order list were able to enter the depot or road stop from the back. I introduced this bug when I "improved" GetTileTrackStatus(). (thanks glx for the report and fix).
author KUDr <KUDr@openttd.org>
date Tue, 29 Aug 2006 19:46:31 +0000
parents b7bbcb0f7ed0
children cb4d3595e74d
files roadveh_cmd.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -1035,13 +1035,13 @@
 	}
 
 	if (IsTileType(tile, MP_STREET)) {
-		if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && !IsTileOwner(tile, v->owner)) {
-			/* Road depot owned by another player */
+		if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && (!IsTileOwner(tile, v->owner) || GetRoadDepotDirection(tile) == enterdir)) {
+			/* Road depot owned by another player or with the wrong orientation */
 			bitmask = 0;
 		}
 	} else if (IsTileType(tile, MP_STATION) && IsRoadStopTile(tile)) {
-		if (!IsTileOwner(tile, v->owner)) {
-			// different station owner
+		if (!IsTileOwner(tile, v->owner) || GetRoadStopDir(tile) == enterdir) {
+			/* different station owner or wrong orientation */
 			bitmask = 0;
 		} else {
 			/* Our station */