diff options
author | orwell96 <orwell@bleipb.de> | 2020-06-12 12:32:46 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2021-02-10 16:36:24 +0100 |
commit | 61329c11a28ca0d68f95f189d3a66c373d7dddc3 (patch) | |
tree | 8e57504f17c86efdadf2b8494e3427e4f947a001 /advtrains_interlocking/signal_api.lua | |
parent | d3b2f614be059e65869a615fe319118c0a354995 (diff) | |
download | advtrains-61329c11a28ca0d68f95f189d3a66c373d7dddc3.tar.gz advtrains-61329c11a28ca0d68f95f189d3a66c373d7dddc3.tar.bz2 advtrains-61329c11a28ca0d68f95f189d3a66c373d7dddc3.zip |
Start using path_invalidate_ahead()
Diffstat (limited to 'advtrains_interlocking/signal_api.lua')
-rw-r--r-- | advtrains_interlocking/signal_api.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/advtrains_interlocking/signal_api.lua b/advtrains_interlocking/signal_api.lua index 7e280ad..bf8622a 100644 --- a/advtrains_interlocking/signal_api.lua +++ b/advtrains_interlocking/signal_api.lua @@ -224,17 +224,17 @@ function advtrains.interlocking.signal_on_aspect_changed(pos) if not ipts then return end local ipos = minetest.string_to_pos(ipts) - local tns = advtrains.occ.get_trains_over(ipos) - for id, sidx in pairs(tns) do --- local train = advtrains.trains[id] - --if train.index <= sidx then - minetest.after(0, advtrains.invalidate_path, id) - --end - end + advtrains.invalidate_all_paths_ahead(ipos) end function advtrains.interlocking.signal_rc_handler(pos, node, player, itemstack, pointed_thing) local pname = player:get_player_name() + local control = player:get_player_control() + if control.aux1 then + advtrains.interlocking.show_ip_form(pos, pname) + return + end + local sigd = advtrains.interlocking.db.get_sigd_for_signal(pos) if sigd then advtrains.interlocking.show_signalling_form(sigd, pname) @@ -243,7 +243,7 @@ function advtrains.interlocking.signal_rc_handler(pos, node, player, itemstack, if ndef.advtrains and ndef.advtrains.set_aspect then -- permit to set aspect manually local function callback(pname, aspect) - ndef.advtrains.set_aspect(pos, node, aspect) + advtrains.interlocking.signal_set_aspect(pos, aspect) end local isasp = ndef.advtrains.get_aspect(pos, node) |