Prioritize LZB callback (possible bugfix for H#100)

h137
orwell96 2019-02-19 15:49:01 +01:00
parent 84f1c3d8a5
commit 391a57f90c
2 changed files with 7 additions and 3 deletions

View File

@ -573,9 +573,13 @@ end
local function mknodecallback(name)
local callt = {}
advtrains["tnc_register_on_"..name] = function(func)
advtrains["tnc_register_on_"..name] = function(func, prio)
assertt(func, "function")
table.insert(callt, func)
if prio then
table.insert(callt, 1, func)
else
table.insert(callt, func)
end
end
return callt, function(pos, id, train, index)
for _,f in ipairs(callt) do

View File

@ -288,4 +288,4 @@ advtrains.te_register_on_update(function(id, train)
end
look_ahead(id, train)
apply_control(id, train)
end)
end, true)