mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-21 23:13:47 +01:00
Fix nil crash when calling unifieddyes.on_dig()
w/o PlayerRef (#21)
This commit is contained in:
parent
3e45f316a3
commit
de6e2e0e35
3
api.lua
3
api.lua
@ -45,10 +45,11 @@ minetest.register_on_placenode(
|
||||
end
|
||||
)
|
||||
|
||||
-- The complementary function: strip-off the color if the node being dug is still white/neutral
|
||||
-- The complementary function: strip-off the color if the node being dug is still white/neutral
|
||||
-- adapted from
|
||||
-- https://github.com/minetest/minetest/blob/fe8d04d0b3c2e3af7c406fb6527f1b5230a30137/builtin/game/item.lua#L460-L562
|
||||
local function node_dig_without_color(pos, node, digger)
|
||||
if not digger then return false end
|
||||
local diggername = digger:get_player_name()
|
||||
|
||||
local def = ItemStack(node.name):get_definition()
|
||||
|
Loading…
Reference in New Issue
Block a user