mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-22 04:12:23 +01:00
found a way for incomplete digtron layouts to be created
This commit is contained in:
parent
556b80bc22
commit
e09f1b9f56
@ -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
|
||||
|
2
util.lua
2
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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user