(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
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user