1
0
mirror of https://github.com/pandorabox-io/banners.git synced 2024-11-12 22:00:17 +01:00

Fixed banners.on_dig() no checking for nil players

This commit is contained in:
shamoanjac 2016-08-09 18:28:57 +02:00
parent c1311b2790
commit 9feea540ee

View File

@ -158,8 +158,10 @@ end
banners.banner_on_dig = function(pos, node, player)
local meta = minetest.get_meta(pos)
local inventory = player:get_inventory()
inventory:add_item("main", {name=node.name, count=1, wear=0, metadata=meta:get_string("banner")})
if player then
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)
end