From be771d9413f3ddddaa5dcb4cbad9055a580499cb Mon Sep 17 00:00:00 2001 From: orwell96 Date: Wed, 11 Oct 2017 12:45:37 +0200 Subject: Prefer saved nodedb node before node loaded from map Possibly fixes bug on linuxworks server. --- advtrains/nodedb.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'advtrains/nodedb.lua') diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua index 862fd53..947c92a 100644 --- a/advtrains/nodedb.lua +++ b/advtrains/nodedb.lua @@ -102,14 +102,16 @@ end --function to get node. track database is not helpful here. function ndb.get_node_or_nil(pos) - local node=minetest.get_node_or_nil(pos) + -- FIX for bug found on linuxworks server: + -- a loaded node might get read before the LBM has updated its state, resulting in wrongly set signals and switches + -- -> Using the saved node prioritarily. + local node = ndb.get_node_raw(pos) if node then return node else - --maybe we have the node in the database... - return ndb.get_node_raw(pos) + --try reading the node from the map + return minetest.get_node_or_nil(pos) end - atprint("ndb.get_node_or_nil",pos,"not found") end function ndb.get_node(pos) local n=ndb.get_node_or_nil(pos) -- cgit v1.2.3