diff options
author | orwell96 <orwell@bleipb.de> | 2018-08-16 19:18:03 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-08-16 19:18:03 +0200 |
commit | 05cb6090ac9537650a900b64768bf3ed959cebed (patch) | |
tree | 11b7e3ab4bb846ab069fc10832b07cb36d6eb6dd /advtrains_luaautomation/pcnaming.lua | |
parent | 5fad61e9c981115a183527ffe58a7bbe26fea4e7 (diff) | |
download | advtrains-05cb6090ac9537650a900b64768bf3ed959cebed.tar.gz advtrains-05cb6090ac9537650a900b64768bf3ed959cebed.tar.bz2 advtrains-05cb6090ac9537650a900b64768bf3ed959cebed.zip |
Move passive API to the advtrains core
to remove dependency of interlocking on luaautomation
Diffstat (limited to 'advtrains_luaautomation/pcnaming.lua')
-rw-r--r-- | advtrains_luaautomation/pcnaming.lua | 18 |
1 files changed, 7 insertions, 11 deletions
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, |