(svn r4338) -Fix (FS#105): Bug introduced in r4290. IsLevelCrossing does NOT check the tile type, it assumes the tile type IS MP_STREET
authorcelestar
Sun, 09 Apr 2006 18:01:06 +0000
changeset 3487 4a4646e24248
parent 3486 cf1e0bbef010
child 3488 d1d5c0f3f69d
(svn r4338) -Fix (FS#105): Bug introduced in r4290. IsLevelCrossing does NOT check the tile type, it assumes the tile type IS MP_STREET
train_cmd.c
--- a/train_cmd.c	Sun Apr 09 17:50:00 2006 +0000
+++ b/train_cmd.c	Sun Apr 09 18:01:06 2006 +0000
@@ -92,7 +92,7 @@
 		if (IsBridgeTile(u->tile) && IsBridgeMiddle(u->tile) && DiagDirToAxis(DirToDiagDir(u->direction)) == GetBridgeAxis(u->tile)) {
 			if (!HasPowerOnRail(u->u.rail.railtype, GetRailTypeOnBridge(u->tile))) engine_has_power = false;
 			if (!HasPowerOnRail(v->u.rail.railtype, GetRailTypeOnBridge(u->tile))) wagon_has_power = false;
-		} else if (IsLevelCrossing(u->tile)) {
+		} else if (IsTileType(u->tile, MP_STREET) && IsLevelCrossing(u->tile)) {
 			if (!HasPowerOnRail(u->u.rail.railtype, GetRailTypeCrossing(u->tile)))	engine_has_power = false;
 			if (!HasPowerOnRail(v->u.rail.railtype, GetRailTypeCrossing(u->tile)))	wagon_has_power = false;
 		} else {