Fix crash when player got killed by arrow

This commit is contained in:
Wuzzy 2017-07-29 15:05:29 +02:00
parent ae70727353
commit 105d9e9790
1 changed files with 7 additions and 5 deletions

View File

@ -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