]> git.lizzy.rs Git - Crafter.git/commitdiff
Fix crashing if no mob head bone
authoroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 19 May 2020 20:29:20 +0000 (16:29 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 19 May 2020 20:29:20 +0000 (16:29 -0400)
mods/mob/api/interaction.lua

index e2dbfdcd1afb80579564b7ecf5c7281b6bd0cecd..c554376e4d25727a30db80e9eea53aa06aa467a1 100644 (file)
@@ -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