diff options
author | Y. Wang <yw05@forksworld.de> | 2022-08-13 16:16:17 +0200 |
---|---|---|
committer | Y. Wang <yw05@forksworld.de> | 2023-03-23 20:06:02 +0100 |
commit | a4abbf8824f893558861bff2893181ae02ed284d (patch) | |
tree | 2aca28114679f5d52c52b868855505c1a56b500e | |
parent | 6ae0615309bd5862a7480686ccba01a24b69356b (diff) | |
download | advtrains-a4abbf8824f893558861bff2893181ae02ed284d.tar.gz advtrains-a4abbf8824f893558861bff2893181ae02ed284d.tar.bz2 advtrains-a4abbf8824f893558861bff2893181ae02ed284d.zip |
Add hotfix for path invalidation
-rw-r--r-- | advtrains_interlocking/routesetting.lua | 3 | ||||
-rw-r--r-- | advtrains_interlocking/signal_api.lua | 6 | ||||
-rw-r--r-- | advtrains_interlocking/signal_aspect_accessors.lua | 5 |
3 files changed, 11 insertions, 3 deletions
diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua index e792d28..9973569 100644 --- a/advtrains_interlocking/routesetting.lua +++ b/advtrains_interlocking/routesetting.lua @@ -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 diff --git a/advtrains_interlocking/signal_api.lua b/advtrains_interlocking/signal_api.lua index 1c6ed27..e615692 100644 --- a/advtrains_interlocking/signal_api.lua +++ b/advtrains_interlocking/signal_api.lua @@ -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) diff --git a/advtrains_interlocking/signal_aspect_accessors.lua b/advtrains_interlocking/signal_aspect_accessors.lua index e23aa13..a1cbd4e 100644 --- a/advtrains_interlocking/signal_aspect_accessors.lua +++ b/advtrains_interlocking/signal_aspect_accessors.lua @@ -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 |