diff --git a/class_layout.lua b/class_layout.lua index 5c96721..70b8bc4 100644 --- a/class_layout.lua +++ b/class_layout.lua @@ -94,9 +94,8 @@ function DigtronLayout.create(pos, player) local node = minetest.get_node(testpos) if node.name == "ignore" then - --buildtron array is next to unloaded nodes, too dangerous to do anything. Abort. - self.all = nil - return self + --digtron array is next to unloaded nodes, too dangerous to do anything. Abort. + self.ignore_touching = true end if minetest.get_item_group(node.name, "water") ~= 0 then diff --git a/util.lua b/util.lua index e791f23..8316fd7 100644 --- a/util.lua +++ b/util.lua @@ -336,7 +336,7 @@ digtron.damage_creatures = function(player, source_pos, target_pos, amount, item if obj:is_player() then -- See issue #2960 for status of a "set player velocity" method -- instead, knock the player back - newpos = { + local newpos = { x = target_pos.x + velocity.x, y = target_pos.y + velocity.y, z = target_pos.z + velocity.z, diff --git a/util_execute_cycle.lua b/util_execute_cycle.lua index 235b12f..212daff 100644 --- a/util_execute_cycle.lua +++ b/util_execute_cycle.lua @@ -45,8 +45,8 @@ end --Performs various tests on a layout to play warning noises and see if Digtron can move at all. local function neighbour_test(layout, status_text, dir) - if layout.all == nil then - -- get_all_digtron_neighbours returns nil if the digtron array touches unloaded nodes, too dangerous to do anything in that situation. Abort. + if layout.ignore_touching == true then + -- if the digtron array touches unloaded nodes, too dangerous to do anything in that situation. Abort. minetest.sound_play("buzzer", {gain=0.25, pos=layout.controller}) return S("Digtron is adjacent to unloaded nodes.") .. "\n" .. status_text, 1 end