Initial implementation of two rail types per tile
This commit is contained in:
@@ -355,7 +355,7 @@ protected:
|
||||
|
||||
/* rail transport is possible only on compatible rail types */
|
||||
if (IsRailTT()) {
|
||||
RailType rail_type = GetTileRailType(m_new_tile);
|
||||
RailType rail_type = GetTileRailTypeByEntryDir(m_new_tile, m_exitdir);
|
||||
if (!HasBit(m_railtypes, rail_type)) {
|
||||
/* incompatible rail type */
|
||||
m_err = EC_RAIL_TYPE;
|
||||
@@ -481,7 +481,7 @@ public:
|
||||
}
|
||||
/* Check for speed limit imposed by railtype */
|
||||
if (IsRailTT()) {
|
||||
uint16 rail_speed = GetRailTypeInfo(GetRailType(m_old_tile))->max_speed;
|
||||
uint16 rail_speed = GetRailTypeInfo(GetRailTypeByTrack(m_old_tile, TrackdirToTrack(m_old_td)))->max_speed;
|
||||
if (rail_speed > 0) max_speed = min(max_speed, rail_speed);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user