mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
/kill destroys totem of undying
This commit is contained in:
parent
38478ee7e3
commit
138005e40f
1 changed files with 8 additions and 0 deletions
|
@ -53,7 +53,15 @@ local function handle_kill_command(suspect, victim)
|
||||||
if not suspect == victim then
|
if not suspect == victim then
|
||||||
minetest.log("action", S("@1 killed @2", suspect, victim))
|
minetest.log("action", S("@1 killed @2", suspect, victim))
|
||||||
end
|
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)
|
victimref:set_hp(0)
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_privilege("clear", {
|
minetest.register_privilege("clear", {
|
||||||
|
|
Loading…
Reference in a new issue