diff options
author | Christopher Head <chead@chead.ca> | 2016-11-16 21:30:53 -0800 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2017-02-28 22:13:19 -0800 |
commit | 25ea72270dec5b0287b2a094d696bc807206b483 (patch) | |
tree | 3e6503e967f02c2f695bd72ff832debc73a1a657 /internal.lua | |
parent | 514fb2e28901c31a9319efaa90615bf440ec3d72 (diff) |
Use VoxelManipulators to force-load nodes.
If a node needed during wire traversal is not currently loaded, it is
loaded from disk using a VoxelManipulator.
Diffstat (limited to 'internal.lua')
-rw-r--r-- | internal.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal.lua b/internal.lua index d012ee2..96f84e7 100644 --- a/internal.lua +++ b/internal.lua @@ -14,7 +14,7 @@ function digiline:importrules(spec, node) end function digiline:getAnyInputRules(pos) - local node = minetest.get_node(pos) + local node = digiline:get_node_force(pos) local spec = digiline:getspec(node) if not spec then return end @@ -27,7 +27,7 @@ function digiline:getAnyInputRules(pos) end function digiline:getAnyOutputRules(pos) - local node = minetest.get_node(pos) + local node = digiline:get_node_force(pos) local spec = digiline:getspec(node) if not spec then return end @@ -86,11 +86,12 @@ local function queue_dequeue(queue) end function digiline:transmit(pos, channel, msg, checked) + digiline:vm_begin() local queue = queue_new() queue_enqueue(queue, pos) while not queue_empty(queue) do local curPos = queue_dequeue(queue) - local node = minetest.get_node(curPos) + local node = digiline:get_node_force(curPos) local spec = digiline:getspec(node) if spec then -- Effector actions --> Receive @@ -114,4 +115,5 @@ function digiline:transmit(pos, channel, msg, checked) end end end + digiline:vm_end() end |