From 105d9e9790cf48f5bb29a6ba4630aeb32a135c6b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 29 Jul 2017 15:05:29 +0200 Subject: [PATCH] Fix crash when player got killed by arrow --- mods/HUD/mcl_death_messages/init.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mods/HUD/mcl_death_messages/init.lua b/mods/HUD/mcl_death_messages/init.lua index a58d6c03bb..8d02609852 100644 --- a/mods/HUD/mcl_death_messages/init.lua +++ b/mods/HUD/mcl_death_messages/init.lua @@ -155,11 +155,13 @@ minetest.register_on_dieplayer(function(player) end -- Arrow elseif last_damages[name].hittertype == "arrow" then - if last_damages[name].hitter:is_player() then - msg = dmsg("arrow_name", name, last_damages[name].hitter:get_player_name()) - elseif last_damages[name].hitter:get_luaentity()._cmi_is_mob then - if last_damages[name].hitter:get_luaentity().nametag ~= "" then - msg = dmsg("arrow_name", name, last_damages[name].hitter:get_player_name()) + if last_damages[name].shooter == nil then + msg = dmsg("arrow", name) + elseif last_damages[name].shooter:is_player() then + msg = dmsg("arrow_name", name, last_damages[name].shooter:get_player_name()) + elseif last_damages[name].shooter:get_luaentity()._cmi_is_mob then + if last_damages[name].shooter:get_luaentity().nametag ~= "" then + msg = dmsg("arrow_name", name, last_damages[name].shooter:get_player_name()) else msg = dmsg("arrow", name) end