aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advtrains/api_doc.txt4
-rw-r--r--advtrains_line_automation/stoprail.lua4
2 files changed, 3 insertions, 5 deletions
diff --git a/advtrains/api_doc.txt b/advtrains/api_doc.txt
index 4413dce..0a2cb44 100644
--- a/advtrains/api_doc.txt
+++ b/advtrains/api_doc.txt
@@ -174,9 +174,9 @@ minetest.register_node(nodename, {
^- the code in these 3 default minetest API functions is required for advtrains to work, however you can add your own code
advtrains = {
- on_train_enter=function(pos, train_id) end
+ on_train_enter=function(pos, train_id, train, index) end
^- called when a train enters the rail
- on_train_leave=function(pos, train_id) end
+ on_train_leave=function(pos, train_id, train, index) end
^- called when a train leaves the rail
-- The following function is only in effect when interlocking is enabled:
diff --git a/advtrains_line_automation/stoprail.lua b/advtrains_line_automation/stoprail.lua
index 2610d1c..6e4a6e2 100644
--- a/advtrains_line_automation/stoprail.lua
+++ b/advtrains_line_automation/stoprail.lua
@@ -146,9 +146,7 @@ local adefunc = function(def, preset, suffix, rotation)
end
end
end,
- on_train_enter = function(pos, train_id)
- local train = advtrains.trains[train_id]
- local index = atfloor(train.index)
+ on_train_enter = function(pos, train_id, train, index)
if train.path_cn[index] == 1 then
local pe = advtrains.encode_pos(pos)
local stdata = advtrains.lines.stops[pe]