]> git.lizzy.rs Git - Crafter.git/blobdiff - mods/mob/api/movement.lua
fix mobs not getting hurt inside hurt_inside group nodes
[Crafter.git] / mods / mob / api / movement.lua
index fa7d3cac5acc409ccd5fa6377d5e8a5915ca6a3d..f92fb8c467360037f542ba10d3361d47c1e56a54 100644 (file)
@@ -34,6 +34,7 @@ mobs.create_movement_functions = function(def,mob_register)
                                        damage_groups = {damage=hurty},
                                })
                        end
+                       self.hurt_inside_timer = 0.25
                else
                        self.hurt_inside_timer = self.hurt_inside_timer - dtime
                end
@@ -189,7 +190,8 @@ mobs.create_movement_functions = function(def,mob_register)
                                        local path = minetest.find_path(self.object:get_pos(),self.following_pos,self.view_distance*2,1,1,"A*")
                                        if path then--or (self.path_data and table.getn(self.path_data) < 3)) then
                                                self.path_data = path
-                                       elseif not path and self.path_data and table.getn(self.path_data) <= 4 then
+                                       end
+                                       if self.path_data and table.getn(self.path_data) <= 4 then
                                                self.path_data = nil
                                        end