From 4cb5b26fa90f1448e63d0960caefcf59c3b8c459 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 25 Feb 2020 16:09:26 +0100 Subject: [PATCH] Fix crash in mcl_mobs --- mods/ENTITIES/mcl_mobs/api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 9ccd43a0..648fef2b 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -2095,9 +2095,9 @@ local do_states = function(self, dtime) local dist = vector.distance(p, s) -- stop attacking if player invisible or out of range - if not object_in_range(self, self.attack) - or not self.attack + if not self.attack or not self.attack:get_pos() + or not object_in_range(self, self.attack) or self.attack:get_hp() <= 0 or (self.attack:is_player() and mobs.invis[ self.attack:get_player_name() ]) then -- 2.11.4.GIT