]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/mob/api/api_hook.lua
disable fall damage for phygs
[Crafter.git] / mods / mob / api / api_hook.lua
index 5b7c1fea6b50963af1f45c589e1945a9a45f0355..3c88b35125dc3495b9e4cf577d9270125d3b3b6a 100644 (file)
@@ -56,6 +56,7 @@ mob_register.dead = false
 
 mob_register.mob = true
 mob_register.hostile = def.hostile
+mob_register.hostile_cooldown = def.hostile_cooldown
 
 mob_register.hostile_timer = 0
 mob_register.timer = 0
@@ -95,10 +96,11 @@ mob_register.attacked_hostile = def.attacked_hostile
 mob_register.projectile_timer = 0
 mob_register.projectile_type = def.projectile_type
 
+mob_register.takes_fall_damage = def.takes_fall_damage or true
 
 mob_register.item_drop = def.item_drop
-mob_register.item_minimum = def.item_minimum or def.item_amount
-mob_register.item_amount = def.item_amount
+mob_register.item_minimum = def.item_minimum or 1
+mob_register.item_max = def.item_max
 
 mob_register.die_in_light = def.die_in_light
 mob_register.die_in_light_level = def.die_in_light_level
@@ -127,11 +129,13 @@ mob_register.on_step = function(self, dtime)
        end
        
        self.collision_detection(self)
-       self.fall_damage(self)
+       if self.fall_damage then
+               self.fall_damage(self)
+       end
        
        if self.dead == false and self.death_animation_timer == 0 then
                self.move(self,dtime)
-               
+               --self.debug_nametag(self,dtime)
                self.manage_hurt_color_timer(self,dtime)
                self.set_animation(self)
                
@@ -140,7 +144,6 @@ mob_register.on_step = function(self, dtime)
                end
                
                self.manage_punch_timer(self,dtime)
-               --self.debug_nametag(self,dtime)
        else
                self.manage_death_animation(self,dtime)
                self.move_head(self,nil,dtime)