use node_dig again, and get rid of pcalls

This commit is contained in:
1F616EMO 2024-09-01 07:17:46 +08:00
parent eb68b33ba9
commit b5c297c1b7
No known key found for this signature in database
GPG key ID: EF52EFA8E05859B2
2 changed files with 3 additions and 13 deletions

View file

@ -1,4 +1,4 @@
title = Minetest Game title = Minetest Game
author = Minetest author = Minetest
description = A basic exploration, mining, crafting, and building, sandbox game with no NPCs, monsters, or animals. Minetest Game is usually used with mods added, and many mods are available for this game. Reliably maintained by Minetest Engine core developers. description = A basic exploration, mining, crafting, and building, sandbox game with no NPCs, monsters, or animals. Minetest Game is usually used with mods added, and many mods are available for this game. Reliably maintained by Minetest Engine core developers.
min_minetest_version = 5.9 min_minetest_version = 5.8

View file

@ -312,18 +312,7 @@ function default.dig_up(pos, node, digger, max_height)
if up_node.name ~= node.name then if up_node.name ~= node.name then
break break
end end
local noerr, success = xpcall(function() if not minetest.node_dig(up_pos, up_node, digger) then
return minetest.dig_node(up_pos, digger)
end, function(...)
in_dig_up = false
local errmsg = "Error raised during `default.dig_up` call: " .. minetest.error_handler(...)
for line in errmsg:gmatch("([^\n]*)\n?") do
minetest.log("error", line)
end
end)
if not noerr then
error("Error raised during `default.dig_up` call")
elseif not success then
break break
end end
end end
@ -334,6 +323,7 @@ minetest.register_globalstep(function()
in_dig_up = false in_dig_up = false
end) end)
-- --
-- Fence registration helper -- Fence registration helper
-- --