aboutsummaryrefslogtreecommitdiff
path: root/advtrains/nodedb.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/nodedb.lua')
-rw-r--r--advtrains/nodedb.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua
index edb3329..9513740 100644
--- a/advtrains/nodedb.lua
+++ b/advtrains/nodedb.lua
@@ -153,10 +153,13 @@ function ndb.update(pos, pnode)
nid=#ndb_nodeids+1
ndb_nodeids[nid]=node.name
end
- ndbset(pos.x, pos.y, pos.z, (nid * 4) + (l2b(node.param2 or 0)) )
- --atprint("nodedb: updating node", pos, "stored nid",nid,"assigned",ndb_nodeids[nid],"resulting cid",ndb_nodes[hash])
+ local resid = (nid * 4) + (l2b(node.param2 or 0))
+ ndbset(pos.x, pos.y, pos.z, resid )
+ --atdebug("nodedb: updating node", pos, "stored nid",nid,"assigned",ndb_nodeids[nid],"resulting cid",resid)
+ advtrains.invalidate_all_paths(pos)
else
--at this position there is no longer a node that needs to be tracked.
+ --atdebug("nodedb: updating node", pos, "cleared")
ndbset(pos.x, pos.y, pos.z, nil)
end
end