From 022efc665917672aac89c26651e8e388e8417edb Mon Sep 17 00:00:00 2001 From: oilboi <47129783+oilboi@users.noreply.github.com> Date: Tue, 19 May 2020 16:29:20 -0400 Subject: [PATCH] Fix crashing if no mob head bone --- mods/mob/api/interaction.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/mob/api/interaction.lua b/mods/mob/api/interaction.lua index e2dbfdc..c554376 100644 --- a/mods/mob/api/interaction.lua +++ b/mods/mob/api/interaction.lua @@ -217,6 +217,10 @@ mobs.create_interaction_functions = function(def,mob_register) global_mob_amount = global_mob_amount - 1 print("Mobs Died. Current Mobs: "..global_mob_amount) + if self.custom_on_death then + self.custom_on_death(self) + end + self.object:remove() end @@ -309,7 +313,9 @@ mobs.create_interaction_functions = function(def,mob_register) end --stare straight if not found if player_found == false then - self.move_head(self,nil,dtime) + if self.move_head then + self.move_head(self,nil,dtime) + end if self.manage_hostile_timer then self.manage_hostile_timer(self,dtime) end