Prefer saved nodedb node before node loaded from map
Possibly fixes bug on linuxworks server.master
parent
6ade65b6d6
commit
be771d9413
|
@ -102,14 +102,16 @@ end
|
||||||
|
|
||||||
--function to get node. track database is not helpful here.
|
--function to get node. track database is not helpful here.
|
||||||
function ndb.get_node_or_nil(pos)
|
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
|
if node then
|
||||||
return node
|
return node
|
||||||
else
|
else
|
||||||
--maybe we have the node in the database...
|
--try reading the node from the map
|
||||||
return ndb.get_node_raw(pos)
|
return minetest.get_node_or_nil(pos)
|
||||||
end
|
end
|
||||||
atprint("ndb.get_node_or_nil",pos,"not found")
|
|
||||||
end
|
end
|
||||||
function ndb.get_node(pos)
|
function ndb.get_node(pos)
|
||||||
local n=ndb.get_node_or_nil(pos)
|
local n=ndb.get_node_or_nil(pos)
|
||||||
|
|
Loading…
Reference in New Issue