Merge branch 'custom_bridgeheads' into jgrpp
# Conflicts: # docs/landscape.html # src/bridge_map.h # src/pbs.cpp # src/saveload/company_sl.cpp # src/saveload/extended_ver_sl.cpp # src/settings_type.h # src/signal.cpp # src/train_cmd.cpp # src/tunnel_map.h # src/tunnelbridge_cmd.cpp # src/tunnelbridge_map.h # src/vehicle.cpp # src/viewport.cpp
This commit is contained in:
@@ -55,6 +55,40 @@ static inline TunnelID GetTunnelIndex(TileIndex t)
|
||||
return map_id == TUNNEL_ID_MAP_LOOKUP ? GetTunnelIndexByLookup(t) : map_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this tile is a rail tunnel
|
||||
* @param t the tile that might be a rail tunnel
|
||||
* @return true if it is a rail tunnel
|
||||
*/
|
||||
static inline bool IsRailTunnelTile(TileIndex t)
|
||||
{
|
||||
return IsTunnelTile(t) && (TransportType)GB(_m[t].m5, 2, 2) == TRANSPORT_RAIL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reservation state of the rail tunnel
|
||||
* @pre IsRailTunnelTile(t)
|
||||
* @param t the tile
|
||||
* @return reservation state
|
||||
*/
|
||||
static inline bool HasTunnelReservation(TileIndex t)
|
||||
{
|
||||
assert(IsRailTunnelTile(t));
|
||||
return HasBit(_m[t].m5, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the reservation state of the rail tunnel
|
||||
* @pre IsRailTunnelTile(t)
|
||||
* @param t the tile
|
||||
* @param b the reservation state
|
||||
*/
|
||||
static inline void SetTunnelReservation(TileIndex t, bool b)
|
||||
{
|
||||
assert(IsRailTunnelTile(t));
|
||||
SB(_m[t].m5, 4, 1, b ? 1 : 0);
|
||||
}
|
||||
|
||||
TileIndex GetOtherTunnelEnd(TileIndex);
|
||||
|
||||
/** Flags for miscellaneous industry tile specialities */
|
||||
|
Reference in New Issue
Block a user