diff options
author | orwell96 <orwell@bleipb.de> | 2021-11-02 23:14:28 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2021-11-02 23:14:28 +0100 |
commit | 35d5106a2141a3de83a8add3996ecc2dfbd141e7 (patch) | |
tree | 1d58d8db5fca4f0cd9afa19c9b259db8f6ee655d /advtrains_luaautomation/pcnaming.lua | |
parent | 75025b13ca3b90c0ed284920ab0f294c54eeb697 (diff) | |
download | advtrains-35d5106a2141a3de83a8add3996ecc2dfbd141e7.tar.gz advtrains-35d5106a2141a3de83a8add3996ecc2dfbd141e7.tar.bz2 advtrains-35d5106a2141a3de83a8add3996ecc2dfbd141e7.zip |
LuaATC PCNaming: Allow naming active components using the tool
Diffstat (limited to 'advtrains_luaautomation/pcnaming.lua')
-rw-r--r-- | advtrains_luaautomation/pcnaming.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/advtrains_luaautomation/pcnaming.lua b/advtrains_luaautomation/pcnaming.lua index ebb769f..71f4d9a 100644 --- a/advtrains_luaautomation/pcnaming.lua +++ b/advtrains_luaautomation/pcnaming.lua @@ -44,7 +44,12 @@ minetest.register_craftitem("advtrains_luaautomation:pcnaming",{ return end local node = advtrains.ndb.get_node(pos) - if node.name and (minetest.get_item_group(node.name, "advtrains_signal")>0 or advtrains.is_passive(pos)) then + local ndef = minetest.registered_nodes[node.name] + if node.name and ( + minetest.get_item_group(node.name, "advtrains_signal")>0 --is IL signal + or advtrains.is_passive(pos) -- is passive component + or (ndef and ndef.luaautomation) -- is active component + ) then --look if this one already has a name local pn="" for name, npos in pairs(atlatc.pcnaming.name_map) do |