Chunnel: Prevent chunnels from intersecting with each other.

This commit is contained in:
Jonathan G Rennison
2017-03-05 19:13:42 +00:00
parent 4c9f7b73b3
commit 93a43da809
4 changed files with 39 additions and 7 deletions

View File

@@ -56,7 +56,16 @@ static inline TunnelID GetTunnelIndex(TileIndex t)
}
TileIndex GetOtherTunnelEnd(TileIndex);
bool IsTunnelInWay(TileIndex, int z, bool chunnel_allowed = false);
/** Flags for miscellaneous industry tile specialities */
enum IsTunnelInWayFlags {
ITIWF_NONE = 0,
ITIWF_IGNORE_CHUNNEL = 1 << 0, ///< Chunnel mid-parts are ignored, used when terraforming.
ITIWF_CHUNNEL_ONLY = 1 << 1, ///< Only check for chunnels
};
DECLARE_ENUM_AS_BIT_SET(IsTunnelInWayFlags)
bool IsTunnelInWay(TileIndex, int z, IsTunnelInWayFlags flags = ITIWF_NONE);
/**
* Set the index of tunnel tile.