From 05cb6090ac9537650a900b64768bf3ed959cebed Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 16 Aug 2018 19:18:03 +0200 Subject: Move passive API to the advtrains core to remove dependency of interlocking on luaautomation --- advtrains_luaautomation/pcnaming.lua | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'advtrains_luaautomation/pcnaming.lua') diff --git a/advtrains_luaautomation/pcnaming.lua b/advtrains_luaautomation/pcnaming.lua index 56ed2d6..4910f1d 100644 --- a/advtrains_luaautomation/pcnaming.lua +++ b/advtrains_luaautomation/pcnaming.lua @@ -38,19 +38,15 @@ minetest.register_craftitem("advtrains_luaautomation:pcnaming",{ minetest.record_protection_violation(pos, pname) return end - local node=minetest.get_node(pos) - local ndef=minetest.registered_nodes[node.name] - if ndef then - if ndef.luaautomation then - --look if this one already has a name - local pn="" - for name, npos in pairs(atlatc.pcnaming.name_map) do - if vector.equals(npos, pos) then - pn=name - end + if advtrains.is_passive(pos) then + --look if this one already has a name + local pn="" + for name, npos in pairs(atlatc.pcnaming.name_map) do + if vector.equals(npos, pos) then + pn=name end - minetest.show_formspec(pname, "atlatc_naming_"..minetest.pos_to_string(pos), "field[pn;Set name of component (empty to clear);"..pn.."]") end + minetest.show_formspec(pname, "atlatc_naming_"..minetest.pos_to_string(pos), "field[pn;Set name of component (empty to clear);"..pn.."]") end end end, -- cgit v1.2.3