mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 22:33:16 -04:00
Bones: Add Drop check
This will check any item before dropping on death to make sure it's a registered item and drops is not empty e.g. ""
This commit is contained in:
parent
b1ab8d5123
commit
02ebb1bdbb
1 changed files with 7 additions and 0 deletions
|
@ -159,6 +159,13 @@ local function may_replace(pos, player)
|
|||
end
|
||||
|
||||
local drop = function(pos, itemstack)
|
||||
|
||||
local def = minetest.registered_items[itemstack:get_name()]
|
||||
-- do not drop items with drops set to ""
|
||||
if not def or (def.drops and def.drops == "") then
|
||||
return
|
||||
end
|
||||
|
||||
local obj = minetest.add_item(pos, itemstack:take_item(itemstack:get_count()))
|
||||
if obj then
|
||||
obj:set_velocity({
|
||||
|
|
Loading…
Add table
Reference in a new issue