diff options
author | smatz <smatz@openttd.org> | 2008-01-04 19:45:29 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-01-04 19:45:29 +0000 |
commit | 7302d8c88b25e08a414ebf4e8e83abffc1c3961a (patch) | |
tree | 9a2deee8e62f246ba97175135518232409950b73 /src/tunnelbridge_map.h | |
parent | 9299f76af42eb4c8ca8d7077fc60f87c2d962047 (diff) | |
download | openttd-7302d8c88b25e08a414ebf4e8e83abffc1c3961a.tar.xz |
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
-Fix: adding road/tram to tram/road bridge was cheaper by one tile
Diffstat (limited to 'src/tunnelbridge_map.h')
-rw-r--r-- | src/tunnelbridge_map.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tunnelbridge_map.h b/src/tunnelbridge_map.h index e9cbe0945..47266442f 100644 --- a/src/tunnelbridge_map.h +++ b/src/tunnelbridge_map.h @@ -8,6 +8,8 @@ #include "direction_func.h" #include "core/bitmath_func.hpp" #include "tile_map.h" +#include "bridge_map.h" +#include "tunnel_map.h" /** @@ -63,4 +65,16 @@ static inline void SetTunnelBridgeSnowOrDesert(TileIndex t, bool snow_or_desert) SB(_m[t].m4, 7, 1, snow_or_desert); } +/** + * Determines type of the wormhole and returns its other end + * @param t one end + * @pre IsTileType(t, MP_TUNNELBRIDGE) + * @return other end + */ +static inline TileIndex GetOtherTunnelBridgeEnd(TileIndex t) +{ + assert(IsTileType(t, MP_TUNNELBRIDGE)); + return IsTunnel(t) ? GetOtherTunnelEnd(t) : GetOtherBridgeEnd(t); +} + #endif /* TUNNELBRIDGE_MAP_H */ |