Is there a simple way to identify the entrance/mouth of a tunnel in a tile?. A specific function for this would be great.
I've been looking through the code but there's nothing in the tunnels descriptor and I'm not sure how I can add this.
It is possible that a combined query will provide this.
tile_x.is_tunnel() && tile_x.get_slope() > 0
or
tile_x.is_tunnel() && tile_x.has_ways()
or
tile_x.is_tunnel() && tile_x.is_ground()
This is also how simutrans check for being in tunnel or not ist_kartenboden() und ist_tunnel(). Works well.