mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Call on_drop for dropped items on player death
Fixes charged bow dropping on death
This commit is contained in:
parent
2ffd16377b
commit
2d721a98cb
1 changed files with 5 additions and 2 deletions
|
@ -24,13 +24,16 @@ minetest.register_on_dieplayer(function(player)
|
|||
pos.x = pos.x + x
|
||||
pos.z = pos.z + z
|
||||
if not void_deadly and drop then
|
||||
local def = minetest.registered_items[stack:get_name()]
|
||||
if def and def.on_drop then
|
||||
stack = def.on_drop(stack, player, pos)
|
||||
end
|
||||
minetest.add_item(pos, stack)
|
||||
end
|
||||
stack:clear()
|
||||
inv:set_stack(listname, i, stack)
|
||||
pos.x = pos.x - x
|
||||
pos.z = pos.z - z
|
||||
end
|
||||
inv:set_list(listname, {})
|
||||
end
|
||||
end
|
||||
armor:set_player_armor(player)
|
||||
|
|
Loading…
Reference in a new issue