diff options
author | orwell96 <orwell@bleipb.de> | 2020-12-27 18:04:42 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2021-02-10 16:39:45 +0100 |
commit | 080b8fb27342827965bab2567dde14e57433b55e (patch) | |
tree | c66ee6fb80a191b09ca9ba4a658c2d5a0b3f533b /advtrains/nodedb.lua | |
parent | 9a775eff5b7a49c322119feb4c8248791edab501 (diff) | |
download | advtrains-080b8fb27342827965bab2567dde14e57433b55e.tar.gz advtrains-080b8fb27342827965bab2567dde14e57433b55e.tar.bz2 advtrains-080b8fb27342827965bab2567dde14e57433b55e.zip |
Add IGNORE_WORLD mode to test using only the advtrains save data
Diffstat (limited to 'advtrains/nodedb.lua')
-rw-r--r-- | advtrains/nodedb.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua index 4539529..ca7b195 100644 --- a/advtrains/nodedb.lua +++ b/advtrains/nodedb.lua @@ -281,6 +281,8 @@ function advtrains.get_rail_info_at(pos, drives_on) return true, conns, railheight end +local IGNORE_WORLD = advtrains.IGNORE_WORLD + ndb.run_lbm = function(pos, node) local cid=ndbget(pos.x, pos.y, pos.z) if cid then @@ -335,7 +337,7 @@ ndb.restore_all = function() if node then local ori_ndef=minetest.registered_nodes[node.name] local ndbnode=ndb.get_node_raw(pos) - if ori_ndef and ori_ndef.groups.save_in_at_nodedb then --check if this node has been worldedited, and don't replace then + if (ori_ndef and ori_ndef.groups.save_in_at_nodedb) or IGNORE_WORLD then --check if this node has been worldedited, and don't replace then if (ndbnode.name~=node.name or ndbnode.param2~=node.param2) then minetest.swap_node(pos, ndbnode) --atlog("Replaced",node.name,"@",pos,"with",ndbnode.name) |