From 080b8fb27342827965bab2567dde14e57433b55e Mon Sep 17 00:00:00 2001 From: orwell96 Date: Sun, 27 Dec 2020 18:04:42 +0100 Subject: Add IGNORE_WORLD mode to test using only the advtrains save data --- advtrains/nodedb.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'advtrains/nodedb.lua') 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) -- cgit v1.2.3