1
0
Fork 0

Fix damaging anvil too aggressively

This commit is contained in:
Wuzzy 2018-02-03 03:43:28 +01:00
parent 9277bf4552
commit 0b80b60cf1
1 changed files with 18 additions and 16 deletions

View File

@ -242,6 +242,7 @@ local anvildef = {
end end
update_anvil_slots(meta) update_anvil_slots(meta)
if from_list == "output" then
local destroyed = damage_anvil(pos, player) local destroyed = damage_anvil(pos, player)
-- Close formspec if anvil was destroyed -- Close formspec if anvil was destroyed
if destroyed then if destroyed then
@ -252,7 +253,7 @@ local anvildef = {
TODO: Update this line when node formspecs get proper identifiers in Minetest. ]] TODO: Update this line when node formspecs get proper identifiers in Minetest. ]]
minetest.close_formspec(player:get_player_name(), "") minetest.close_formspec(player:get_player_name(), "")
end end
end
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -272,13 +273,14 @@ local anvildef = {
end end
end end
update_anvil_slots(meta) update_anvil_slots(meta)
if listname == "output" then
local destroyed = damage_anvil(pos, player) local destroyed = damage_anvil(pos, player)
-- Close formspec if anvil was destroyed -- Close formspec if anvil was destroyed
if destroyed then if destroyed then
-- See above for justification. -- See above for justification.
minetest.close_formspec(player:get_player_name(), "") minetest.close_formspec(player:get_player_name(), "")
end end
end
end, end,
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)