forked from mtcontrib/pipeworks
Fix crash with legacy nodebreakers
This commit is contained in:
parent
a31a9d573f
commit
5a5bb3bf12
@ -271,10 +271,12 @@ minetest.register_node("pipeworks:nodebreaker_off", {
|
|||||||
minetest.get_meta(pos):set_string("owner", placer:get_player_name())
|
minetest.get_meta(pos):set_string("owner", placer:get_player_name())
|
||||||
end,
|
end,
|
||||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
if oldmetadata.inventory.pick then
|
||||||
local stack = oldmetadata.inventory.pick[1]
|
local stack = oldmetadata.inventory.pick[1]
|
||||||
if not stack:is_empty() then
|
if not stack:is_empty() then
|
||||||
minetest.add_item(pos, stack)
|
minetest.add_item(pos, stack)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
pipeworks.scan_for_tube_objects(pos, oldnode, oldmetadata, digger)
|
pipeworks.scan_for_tube_objects(pos, oldnode, oldmetadata, digger)
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
@ -369,10 +371,12 @@ minetest.register_node("pipeworks:nodebreaker_on", {
|
|||||||
minetest.get_meta(pos):set_string("owner", placer:get_player_name())
|
minetest.get_meta(pos):set_string("owner", placer:get_player_name())
|
||||||
end,
|
end,
|
||||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
|
if oldmetadata.inventory.pick then
|
||||||
local stack = oldmetadata.inventory.pick[1]
|
local stack = oldmetadata.inventory.pick[1]
|
||||||
if not stack:is_empty() then
|
if not stack:is_empty() then
|
||||||
minetest.add_item(pos, stack)
|
minetest.add_item(pos, stack)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
pipeworks.scan_for_tube_objects(pos, oldnode, oldmetadata, digger)
|
pipeworks.scan_for_tube_objects(pos, oldnode, oldmetadata, digger)
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
Loading…
Reference in New Issue
Block a user