Fix crash with ghast achievement fireball_redir_serv (#4179)

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4179
Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-authored-by: Araca <araca.prod@gmail.com>
Co-committed-by: Araca <araca.prod@gmail.com>
This commit is contained in:
Araca 2024-05-01 22:15:56 +00:00 committed by the-real-herowl
parent 0c372f987d
commit cd0509c2e6

View file

@ -132,7 +132,7 @@ mcl_mobs.register_arrow("mobs_mc:fireball", {
}, nil)
mcl_mobs.mob_class.boom(self,self.object:get_pos(), 1, true)
local ent = mob:get_luaentity()
if not ent or ent.health <= 0 then
if (not ent or ent.health <= 0) and self._puncher then
awards.unlock(self._puncher:get_player_name(), "mcl:fireball_redir_serv")
end
end,