(svn r2541) -Feature: Modified IsCompatibleRail so that an engine can move on more
than one railtype (like Diesel engines on electrified rail). -Codechange: Use IsCompatibleRail where it should be used
This commit is contained in:
8
rail.h
8
rail.h
@@ -505,7 +505,13 @@ static inline TransportType GetCrossingTransportType(TileIndex tile, Track track
|
||||
*/
|
||||
static inline bool IsCompatibleRail(RailType enginetype, RailType tiletype)
|
||||
{
|
||||
return enginetype == tiletype;
|
||||
static const bool EquivRailTypes[RAILTYPE_END][RAILTYPE_END] = {
|
||||
{ true, false, false },
|
||||
{ false, true, false },
|
||||
{ false, false, true },
|
||||
};
|
||||
|
||||
return EquivRailTypes[enginetype][tiletype];
|
||||
}
|
||||
|
||||
#endif // RAIL_H
|
||||
|
||||
Reference in New Issue
Block a user