aboutsummaryrefslogtreecommitdiff
path: root/advtrains/lzb.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-11-25 20:18:25 +0100
committerorwell <orwell@bleipb.de>2024-11-25 20:18:25 +0100
commit73c393e223b1d2d81b767d8036c7fdec7ca20100 (patch)
treea344eead17f3383c4d6d7f1aa6f8916c68db1afc /advtrains/lzb.lua
parentfe57e7dd089653e2361a4ebb0b34137a3261e198 (diff)
downloadadvtrains-73c393e223b1d2d81b767d8036c7fdec7ca20100.tar.gz
advtrains-73c393e223b1d2d81b767d8036c7fdec7ca20100.tar.bz2
advtrains-73c393e223b1d2d81b767d8036c7fdec7ca20100.zip
Node Callbacks: Call Enter/Leave at center of rail (.0 index)
- Unifies behavior of LZB and node callbacks (has_entered is obsoleted) - Permits to set signal influence point on a TCB without issues - Potentially solves bug which was happening when reversing a train at exactly index .5 (PS: Och_Noe will not like this :)
Diffstat (limited to 'advtrains/lzb.lua')
-rw-r--r--advtrains/lzb.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/advtrains/lzb.lua b/advtrains/lzb.lua
index 52c2289..2853218 100644
--- a/advtrains/lzb.lua
+++ b/advtrains/lzb.lua
@@ -29,8 +29,9 @@ The LZB subsystem keeps track of "checkpoints" the train will pass in the future
To perform 2, it populates the train.path_speed table which is handled along with the path subsystem.
This table is used in trainlogic.lua/train_step_b() and applied to the velocity calculations.
-Note: in contrast to node enter callbacks, which are called when the train passes the .5 index mark, LZB callbacks are executed on passing the .0 index mark!
-If an LZB checkpoint has speed 0, the train will still enter the node (the enter callback will be called), but will stop at the 0.9 index mark (for details, see SLOW_APPROACH in trainlogic.lua)
+Note: As of 2024-11-25, node enter callbacks as well as LZB callbacks are executed on passing the .0 index mark!
+If an LZB checkpoint has speed 0, it will stop at the 0.9 index mark (for details, see SLOW_APPROACH in trainlogic.lua) and will not enter the node.
+(previous behavior: node enter callback was called at .5 index mark)
The start point for the LZB traverser (and thus the first node that will receive an approach callback) is floor(train.index) + 1. This means, once the LZB checkpoint callback has fired,
this path node will not receive any further approach callbacks for the same approach situation