mirror of
https://github.com/pandorabox-io/banners.git
synced 2025-01-08 17:10:32 +01:00
Fixed banners.on_dig() no checking for nil players
This commit is contained in:
parent
c1311b2790
commit
9feea540ee
6
init.lua
6
init.lua
@ -158,8 +158,10 @@ end
|
|||||||
|
|
||||||
banners.banner_on_dig = function(pos, node, player)
|
banners.banner_on_dig = function(pos, node, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inventory = player:get_inventory()
|
if player then
|
||||||
inventory:add_item("main", {name=node.name, count=1, wear=0, metadata=meta:get_string("banner")})
|
local inventory = player:get_inventory()
|
||||||
|
inventory:add_item("main", {name=node.name, count=1, wear=0, metadata=meta:get_string("banner")})
|
||||||
|
end
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user