From 138005e40f4614fb5145b6d54b2453d32ee078a5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 25 Jan 2018 21:50:59 +0100 Subject: [PATCH] /kill destroys totem of undying --- mods/MISC/mcl_commands/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/MISC/mcl_commands/init.lua b/mods/MISC/mcl_commands/init.lua index 370e929b3..e95f2ad64 100644 --- a/mods/MISC/mcl_commands/init.lua +++ b/mods/MISC/mcl_commands/init.lua @@ -53,7 +53,15 @@ local function handle_kill_command(suspect, victim) if not suspect == victim then minetest.log("action", S("@1 killed @2", suspect, victim)) end + -- If player holds a totem of undying, destroy it before killing, + -- so it doesn't rescue the player. + local wield = victimref:get_wielded_item() + if wield:get_name() == "mobs_mc:totem" then + victimref:set_wielded_item("") + end + -- DIE! victimref:set_hp(0) + return true end minetest.register_privilege("clear", {