Revert call dignodedef:can_dig with player of owner

the api allow nil player so it is a problem that the bone mod should fix.
also, if the player is offline, minetest.get_player_by_name would return nil too
This commit is contained in:
Karl Hegbloom 2015-11-27 18:13:32 -07:00
parent af56538ff1
commit 915d67a261

View File

@ -128,7 +128,6 @@ local function quarry_run(pos, node)
local data = vm:get_data()
local c_air = minetest.get_content_id("air")
local owner = meta:get_string("owner")
local player = minetest.get_player_by_name(owner)
local nd = meta:get_int("dug")
while nd ~= diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) do
local ry = math.floor(nd / (diameter*diameter))
@ -151,7 +150,7 @@ local function quarry_run(pos, node)
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}
if not dignodedef.diggable or (dignodedef.can_dig and not dignodedef.can_dig(digpos, player)) then
if not dignodedef.diggable or (dignodedef.can_dig and not dignodedef.can_dig(digpos, nil)) then
can_dig = false
end
end