found a way for incomplete digtron layouts to be created

This commit is contained in:
FaceDeer 2019-01-13 16:02:41 -07:00
parent 556b80bc22
commit e09f1b9f56
3 changed files with 5 additions and 6 deletions

@ -94,9 +94,8 @@ function DigtronLayout.create(pos, player)
local node = minetest.get_node(testpos) local node = minetest.get_node(testpos)
if node.name == "ignore" then if node.name == "ignore" then
--buildtron array is next to unloaded nodes, too dangerous to do anything. Abort. --digtron array is next to unloaded nodes, too dangerous to do anything. Abort.
self.all = nil self.ignore_touching = true
return self
end end
if minetest.get_item_group(node.name, "water") ~= 0 then if minetest.get_item_group(node.name, "water") ~= 0 then

@ -336,7 +336,7 @@ digtron.damage_creatures = function(player, source_pos, target_pos, amount, item
if obj:is_player() then if obj:is_player() then
-- See issue #2960 for status of a "set player velocity" method -- See issue #2960 for status of a "set player velocity" method
-- instead, knock the player back -- instead, knock the player back
newpos = { local newpos = {
x = target_pos.x + velocity.x, x = target_pos.x + velocity.x,
y = target_pos.y + velocity.y, y = target_pos.y + velocity.y,
z = target_pos.z + velocity.z, z = target_pos.z + velocity.z,

@ -45,8 +45,8 @@ end
--Performs various tests on a layout to play warning noises and see if Digtron can move at all. --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) local function neighbour_test(layout, status_text, dir)
if layout.all == nil then if layout.ignore_touching == true then
-- get_all_digtron_neighbours returns nil if the digtron array touches unloaded nodes, too dangerous to do anything in that situation. Abort. -- 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}) minetest.sound_play("buzzer", {gain=0.25, pos=layout.controller})
return S("Digtron is adjacent to unloaded nodes.") .. "\n" .. status_text, 1 return S("Digtron is adjacent to unloaded nodes.") .. "\n" .. status_text, 1
end end