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:
parent
c1311b2790
commit
9feea540ee
6
init.lua
6
init.lua
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user