Add hotfix for path invalidation

This commit is contained in:
Y. Wang 2022-08-13 16:16:17 +02:00
parent 6ae0615309
commit a4abbf8824
No known key found for this signature in database
GPG Key ID: 54A05DDF18D7A0EB
3 changed files with 11 additions and 3 deletions

View File

@ -341,7 +341,8 @@ function ilrs.update_route(sigd, tcbs, newrte, cancel)
end
else
--atdebug("Committed Route:",tcbs.routeset)
has_changed_aspect = true
-- set_route now sets the signal aspects
--has_changed_aspect = true
end
end
if has_changed_aspect then

View File

@ -227,8 +227,10 @@ function advtrains.interlocking.signal_on_aspect_changed(pos)
local ipts, iconn = advtrains.interlocking.db.get_ip_by_signalpos(pos)
if not ipts then return end
local ipos = minetest.string_to_pos(ipts)
advtrains.invalidate_all_paths_ahead(ipos)
-- FIXME: invalidate_all_paths_ahead does not appear to always work as expected
--advtrains.invalidate_all_paths_ahead(ipos)
minetest.after(0, advtrains.invalidate_all_paths, ipos)
end
function advtrains.interlocking.signal_rc_handler(pos, node, player, itemstack, pointed_thing)

View File

@ -108,6 +108,11 @@ local function set_aspect(pos, asp, skipdst)
if (not skipdst) and aspect_changed then
D.update_main(pos)
end
--[[
local dbgmsg = string.format("[%s]set_aspect(%s,%s,%s)", os.clock(), minetest.pos_to_string(pos), minetest.serialize(asp), tostring(skipdst))
dbgmsg = debug.traceback(dbgmsg, 2)
minetest.chat_send_all(dbgmsg)
--]]
end
end