Fix stop rails sometimes not sending stop command
This commit is contained in:
parent
ee079d02ff
commit
84f1c3d8a5
|
@ -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:
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue