From 377bf31c5d30f064d8e570d1fd7612fe878892d5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Feb 2020 02:40:07 +0100 Subject: [PATCH] Fix crash when killing player with dispenser arrow --- mods/HUD/mcl_death_messages/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/HUD/mcl_death_messages/init.lua b/mods/HUD/mcl_death_messages/init.lua index ce87118d..7bfef748 100644 --- a/mods/HUD/mcl_death_messages/init.lua +++ b/mods/HUD/mcl_death_messages/init.lua @@ -198,12 +198,13 @@ minetest.register_on_dieplayer(function(player, reason) if hitter:get_luaentity()._shooter then shooter = hitter:get_luaentity()._shooter end - local s_ent = shooter:get_luaentity() + local is_mob = false + local s_ent = shooter and shooter:get_luaentity() if shooter == nil then msg = dmsg("arrow", name) elseif shooter:is_player() then msg = dmsg("arrow_name", name, shooter:get_player_name()) - elseif s_ent._cmi_is_mob then + elseif s_ent and s_ent._cmi_is_mob then if s_ent.nametag ~= "" then msg = dmsg("arrow_name", name, shooter:get_player_name()) elseif s_ent.name == "mobs_mc:skeleton" then