Prefer saved nodedb node before node loaded from map

Possibly fixes bug on linuxworks server.
master
orwell96 2017-10-11 12:45:37 +02:00
parent 6ade65b6d6
commit be771d9413
1 changed files with 6 additions and 4 deletions

View File

@ -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)