mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-22 15:33:52 +01:00
Fix nil crash when calling unifieddyes.on_dig()
w/o PlayerRef (#21)
This commit is contained in:
parent
3e45f316a3
commit
de6e2e0e35
1
api.lua
1
api.lua
@ -49,6 +49,7 @@ minetest.register_on_placenode(
|
|||||||
-- adapted from
|
-- adapted from
|
||||||
-- https://github.com/minetest/minetest/blob/fe8d04d0b3c2e3af7c406fb6527f1b5230a30137/builtin/game/item.lua#L460-L562
|
-- https://github.com/minetest/minetest/blob/fe8d04d0b3c2e3af7c406fb6527f1b5230a30137/builtin/game/item.lua#L460-L562
|
||||||
local function node_dig_without_color(pos, node, digger)
|
local function node_dig_without_color(pos, node, digger)
|
||||||
|
if not digger then return false end
|
||||||
local diggername = digger:get_player_name()
|
local diggername = digger:get_player_name()
|
||||||
|
|
||||||
local def = ItemStack(node.name):get_definition()
|
local def = ItemStack(node.name):get_definition()
|
||||||
|
Loading…
Reference in New Issue
Block a user