News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Is a tunnel entrance

Started by Yona-TYT, December 18, 2024, 04:34:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

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.

Andarix

#1
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()

prissi

This is also how simutrans check for being in tunnel or not ist_kartenboden() und ist_tunnel(). Works well.