]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/mob/api/api_hook.lua
Overhaul mob collisionboxes and texture mod handling when hurt
[Crafter.git] / mods / mob / api / api_hook.lua
index d4913a4b81bdb92f46a99cedd782e7c42bc4e7fb..4a79a895cea50cdbcb05061f033345eef67f883b 100644 (file)
@@ -13,7 +13,7 @@ mobs.register_mob = function(def)
 
 
 
-mob_register = {}
+local mob_register = {}
 
 ------------------------------------------------
 mob_register.initial_properties = {
@@ -101,6 +101,7 @@ mob_register.die_in_light = def.die_in_light
 mob_register.die_in_light_level = def.die_in_light_level
 
 mob_register.current_animation = 0
+mob_register.hurt_color_timer = 0
 
 mob_register.mob = true
 
@@ -124,6 +125,8 @@ mob_register.on_step = function(self, dtime)
        
        if self.dead == false and self.death_animation_timer == 0 then
                self.move(self,dtime)
+               
+               self.manage_hurt_color_timer(self,dtime)
                self.set_animation(self)
                
                if self.look_around then