Compare commits

...

5 Commits

Author SHA1 Message Date
Vitaliy 6d20b4a0b2
Fix overheating in protected areas
Merge pull request GH#11 from Lejo1/protect_drop

Destroy modules with `remove_node` instead of `dig_node` that doesn’t work in protected areas.
2020-06-01 20:21:24 +03:00
Lejo1 1c38a8d01e
Destroy modules also if area is protected(using minetest.remove_node) 2020-05-26 18:03:56 +02:00
Vitaliy 5de15c5317
Prevent breakage of multinode devices (merge of GH#8) 2020-05-21 16:21:32 +03:00
numzero 3d6132d1a6 Prevent placing multinodes into non-buildable-to nodes 2020-05-21 13:42:34 +03:00
numzero 5044de8542 Prevent pushing multinode parts by pistons/movestones
These could damage multinode devices pushing single node only
2020-05-21 00:00:00 +03:00
4 changed files with 18 additions and 8 deletions

View File

@ -18,7 +18,7 @@ end
local function diode_action(pos, node, channel, msg)
if digiline_routing.overheat.heat(pos) > OVERLOAD_THRESHOLD then
digiline_routing.overheat.forget(pos)
minetest.dig_node(pos)
minetest.remove_node(pos)
minetest.add_item(pos, node.name)
return
end

View File

@ -46,9 +46,10 @@ local function filter_cleanup(pos, node)
digiline_routing.multiblock.dig2(pos, node)
end
local function filter_test(master, channel)
local function filter_test(master, channel, node)
if digiline_routing.overheat.heat(master) > OVERLOAD_THRESHOLD then
minetest.dig_node(master)
minetest.remove_node(master)
filter_cleanup(master, node)
minetest.add_item(master, "digiline_routing:filter")
return false
end
@ -56,7 +57,7 @@ local function filter_test(master, channel)
end
local function filter_in_action(pos, node, channel, msg)
if filter_test(pos, channel) then
if filter_test(pos, channel, node) then
local off = minetest.facedir_to_dir(node.param2)
local slave = vector.add(pos, off)
digiline:receptor_send(slave, filter_rules_out(node), channel, msg)
@ -66,7 +67,7 @@ end
local function filter_out_action(pos, node, channel, msg)
local off = minetest.facedir_to_dir(node.param2)
local master = vector.subtract(pos, off)
if filter_test(master, channel) then
if filter_test(master, channel, node) then
digiline:receptor_send(master, filter_rules_in(node), channel, msg)
end
end
@ -115,6 +116,7 @@ minetest.register_node("digiline_routing:filter", {
},
},
})
mesecon.register_mvps_stopper("digiline_routing:filter")
minetest.register_node("digiline_routing:filter_b", {
description = "<<INTERNAL>> Digiline Filter (Part B)",
@ -144,3 +146,4 @@ minetest.register_node("digiline_routing:filter_b", {
},
},
})
mesecon.register_mvps_stopper("digiline_routing:filter_b")

View File

@ -5,11 +5,14 @@ digiline_routing.multiblock = {}
digiline_routing.multiblock.build2 = function(node1, node2, itemstack, placer, pointed_thing)
local under = pointed_thing.under
local above = pointed_thing.above
local pos
if minetest.registered_items[minetest.get_node(under).name].buildable_to then
pos = under
elseif minetest.registered_items[minetest.get_node(above).name].buildable_to then
pos = above
else
pos = pointed_thing.above
return itemstack, false
end
if digiline_routing.is_protected(pos, placer) then

View File

@ -27,7 +27,8 @@ end
local function splitter_in_action(pos, node, channel, msg)
if digiline_routing.overheat.heat(pos) > OVERLOAD_THRESHOLD then
minetest.dig_node(pos)
minetest.remove_node(pos)
splitter_cleanup(pos, node)
minetest.add_item(pos, "digiline_routing:splitter")
return
end
@ -40,7 +41,8 @@ local function splitter_out_action(pos, node, channel, msg)
local off = minetest.facedir_to_dir(node.param2)
local master = vector.subtract(pos, off)
if digiline_routing.overheat.heat(master) > OVERLOAD_THRESHOLD then
minetest.dig_node(master)
minetest.remove_node(master)
splitter_cleanup(master, node)
minetest.add_item(master, "digiline_routing:splitter")
return
end
@ -84,6 +86,7 @@ minetest.register_node("digiline_routing:splitter", {
},
},
})
mesecon.register_mvps_stopper("digiline_routing:splitter")
minetest.register_node("digiline_routing:splitter_b", {
description = "<<INTERNAL>> Digiline Splitter (Part B)",
@ -113,3 +116,4 @@ minetest.register_node("digiline_routing:splitter_b", {
},
},
})
mesecon.register_mvps_stopper("digiline_routing:splitter_b")