mirror of
https://github.com/minetest-mods/technic.git
synced 2024-09-27 15:00:18 +02:00
handling exceptions when quarry digs (eg. when player is nil)
issues 172, 231, for example with item bones:bones
This commit is contained in:
parent
a793747d92
commit
1f111c55e5
|
@ -147,6 +147,8 @@ local function quarry_run(pos, node)
|
|||
can_dig = false
|
||||
end
|
||||
local dignode
|
||||
if not pcall(
|
||||
function ()
|
||||
if can_dig then
|
||||
dignode = technic.get_or_load_node(digpos) or minetest.get_node(digpos)
|
||||
local dignodedef = minetest.registered_nodes[dignode.name] or {diggable=false}
|
||||
|
@ -165,6 +167,16 @@ local function quarry_run(pos, node)
|
|||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
then
|
||||
-- handle exception caused by nil player - issue 172 & 231
|
||||
dignode = technic.get_or_load_node(digpos) or minetest.get_node(digpos)
|
||||
message = "ERROR: technic/machines/HV/quarry.lua: unhandled exception digging... skipping block: "
|
||||
message = message .. "digpos = (" .. digpos.x .. "," .. digpos.y .. "," .. digpos.z .. ")"
|
||||
message = message .. ", name = " .. dignode.name
|
||||
print(message)
|
||||
can_dig = false
|
||||
end
|
||||
nd = nd + 1
|
||||
if can_dig then
|
||||
minetest.remove_node(digpos)
|
||||
|
|
Loading…
Reference in New Issue
Block a user