I need something like "get_dirs ()" to get the direction to where a signal is pointing.
(https://www.mediafire.com/convkey/430b/wx6be8tp3vwzw3v6g.jpg)
get_dirs_masked() returns the ribi after applying any mask, like signals. So while the way ribi is 10 (N-S) with a one-way sign it can be 8 (N) or 2 (S).
Quote from: An_dz on January 02, 2017, 02:39:10 AM
get_dirs_masked() returns the ribi after applying any mask, like signals. So while the way ribi is 10 (N-S) with a one-way sign it can be 8 (N) or 2 (S).
This does not work, regardless of the position of the signal, the ribi is always 10 or 5.
Sorry for reviving this issue, but I'm having the same problem with the drag when I try to place passing signs.
Is it possible to fix this too?
(https://www.mediafire.com/convkey/430b/wx6be8tp3vwzw3v6g.jpg)
It's probably a bug, let's wait for Dwachs to confirm.
What exactly is the problem?
Do you want to restrict signal placement? And this does not work well with dragging?
Edit: you can use the forbid_way_tool* routines to restrict signal building.
Quote from: Dwachs on January 04, 2017, 09:41:15 AM
What exactly is the problem?
Do you want to restrict signal placement? And this does not work well with dragging?
Edit: you can use the forbid_way_tool* routines to restrict signal building.
Because "get_dirs_masked ()" is not working... http://forum.simutrans.com/index.php?topic=16545.msg157727#msg157727 (http://forum.simutrans.com/index.php?topic=16545.msg157727#msg157727)
I am trying to determine the position of the signal, and for that I must count the number of times it is clicked.
By the way, my intention with this is to use the tutorial to explain a bit as is the placement of signals in Simutrans.
There was indeed a bug. Should be fixed with r7988.
There are also the functions tile_x::get_way_dirs (_masked) which might be more efficient to use.
It works fine now, thank you. ;)