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)
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

@ -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,

@ -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