aboutsummaryrefslogtreecommitdiff
path: root/advtrains/nodedb.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2021-02-04 12:35:24 +0100
committerorwell96 <orwell@bleipb.de>2021-02-04 12:35:24 +0100
commite935136d58dc863541a6a53c6f5e9f9d218e6661 (patch)
tree50d1dea4941799bd095e920fb1e89c493d7d283b /advtrains/nodedb.lua
parent8ae405f00f7073bca8cb621612ab11bc730228a3 (diff)
downloadadvtrains-e935136d58dc863541a6a53c6f5e9f9d218e6661.tar.gz
advtrains-e935136d58dc863541a6a53c6f5e9f9d218e6661.tar.bz2
advtrains-e935136d58dc863541a6a53c6f5e9f9d218e6661.zip
Make is_node_loaded() checks also for mesecon interactions and digiline_send(), move on_updated_from_nodedb to advtrains table
Diffstat (limited to 'advtrains/nodedb.lua')
-rw-r--r--advtrains/nodedb.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua
index bdde44a..878ed88 100644
--- a/advtrains/nodedb.lua
+++ b/advtrains/nodedb.lua
@@ -294,11 +294,12 @@ ndb.run_lbm = function(pos, node)
ndb.update(pos, node)
else
if (nodeid~=node.name or param2~=node.param2) then
- atprint("nodedb: lbm replaced", pos, "with nodeid", nodeid, "param2", param2, "cid is", cid)
- minetest.swap_node(pos, {name=nodeid, param2 = param2})
+ --atprint("nodedb: lbm replaced", pos, "with nodeid", nodeid, "param2", param2, "cid is", cid)
+ local newnode = {name=nodeid, param2 = param2}
+ minetest.swap_node(pos, newnode)
local ndef=minetest.registered_nodes[nodeid]
- if ndef and ndef.on_updated_from_nodedb then
- ndef.on_updated_from_nodedb(pos, node)
+ if ndef and ndef.advtrains and ndef.advtrains.on_updated_from_nodedb then
+ ndef.advtrains.on_updated_from_nodedb(pos, newnode)
end
return true
end