From eb7ae5e10e731fc949a9a4184e02a39103f83a1e Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Fri, 23 Apr 2021 16:28:30 -0400 Subject: [PATCH 1/2] Fix random crash --- mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index 6f5de1300f..cf397d97ad 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -85,6 +85,11 @@ end -- states are executed here local land_state_execution = function(self,dtime) + --no collisionbox exception + if not self.object:get_properties() then + return + end + local pos = self.object:get_pos() local collisionbox = self.object:get_properties().collisionbox --get the center of the mob From 73b4d3c1d2c74cb5bd5bb23604ce1d74e183cb0d Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Fri, 23 Apr 2021 16:31:13 -0400 Subject: [PATCH 2/2] stop projectile mobs from being completely disabled while stunned --- mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua index cf397d97ad..f914ab9d58 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/ai.lua @@ -744,6 +744,14 @@ mobs.mob_step = function(self, dtime) self.pause_timer = 0 end + --stop projectile mobs from being completely disabled while stunned + if self.projectile_timer and self.projectile_timer > 0.01 then + self.projectile_timer = self.projectile_timer - dtime + if self.projectile_timer < 0.01 then + self.projectile_timer = 0.01 + end + end + return -- don't allow collision detection --do normal ai else