(svn r8935) -Codechange: unification of track type between road and rail tiles, unification of ground type between normal rail tiles and depots/waypoints and removing the need for RailTileSubType.

This commit is contained in:
rubidium
2007-02-27 23:36:28 +00:00
parent a7d9cbc151
commit b5a997a446
12 changed files with 108 additions and 114 deletions

View File

@@ -67,7 +67,7 @@ void TrainPowerChanged(Vehicle* v)
/* Power is not added for articulated parts */
if (IsArticulatedPart(u)) continue;
RailType railtype = (IsLevelCrossingTile(u->tile) ? GetRailTypeCrossing(u->tile) : GetRailType(u->tile));
RailType railtype = GetRailType(u->tile);
bool engine_has_power = HasPowerOnRail(u->u.rail.railtype, railtype);
bool wagon_has_power = HasPowerOnRail(v->u.rail.railtype, railtype);
@@ -2705,10 +2705,7 @@ static bool CheckCompatibleRail(const Vehicle *v, TileIndex tile)
return
IsTileOwner(tile, v->owner) && (
!IsFrontEngine(v) ||
HASBIT(
v->u.rail.compatible_railtypes,
IsTileType(tile, MP_STREET) ? GetRailTypeCrossing(tile) : GetRailType(tile)
)
HASBIT(v->u.rail.compatible_railtypes, GetRailType(tile))
);
}