diff options
author | celestar <celestar@openttd.org> | 2005-07-10 01:25:17 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2005-07-10 01:25:17 +0000 |
commit | b45eee31570afd2045d199dd18a154c42952ad56 (patch) | |
tree | 4d36e1b0eda6ff1c3c42c8febff1fa7cf3ae7484 /rail.h | |
parent | 5286a014ecd5ce1e846a67e5651dc83dd6d09624 (diff) | |
download | openttd-b45eee31570afd2045d199dd18a154c42952ad56.tar.xz |
(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
Diffstat (limited to 'rail.h')
-rw-r--r-- | rail.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |