mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 05:43:43 +01:00
Fix crash when killing player with dispenser arrow
This commit is contained in:
parent
3836f1b7e9
commit
377bf31c5d
@ -198,12 +198,13 @@ minetest.register_on_dieplayer(function(player, reason)
|
|||||||
if hitter:get_luaentity()._shooter then
|
if hitter:get_luaentity()._shooter then
|
||||||
shooter = hitter:get_luaentity()._shooter
|
shooter = hitter:get_luaentity()._shooter
|
||||||
end
|
end
|
||||||
local s_ent = shooter:get_luaentity()
|
local is_mob = false
|
||||||
|
local s_ent = shooter and shooter:get_luaentity()
|
||||||
if shooter == nil then
|
if shooter == nil then
|
||||||
msg = dmsg("arrow", name)
|
msg = dmsg("arrow", name)
|
||||||
elseif shooter:is_player() then
|
elseif shooter:is_player() then
|
||||||
msg = dmsg("arrow_name", name, shooter:get_player_name())
|
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
|
if s_ent.nametag ~= "" then
|
||||||
msg = dmsg("arrow_name", name, shooter:get_player_name())
|
msg = dmsg("arrow_name", name, shooter:get_player_name())
|
||||||
elseif s_ent.name == "mobs_mc:skeleton" then
|
elseif s_ent.name == "mobs_mc:skeleton" then
|
||||||
|
Loading…
Reference in New Issue
Block a user