From 2d721a98cb7a31db699b258d8d0de81bcc80e606 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 11 Feb 2019 18:55:48 +0100 Subject: [PATCH] Call on_drop for dropped items on player death Fixes charged bow dropping on death --- mods/PLAYER/mcl_death_drop/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/PLAYER/mcl_death_drop/init.lua b/mods/PLAYER/mcl_death_drop/init.lua index 1b033bae4d..5f4b1ddb9f 100644 --- a/mods/PLAYER/mcl_death_drop/init.lua +++ b/mods/PLAYER/mcl_death_drop/init.lua @@ -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)