From 8d87ac8f0e7cc55d938bb609d0b69f84f8248637 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 3 Jun 2017 00:37:50 +0200 Subject: [PATCH] =?UTF-8?q?Mobs:=20Switch=20to=20A*=20once=20again=20?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mods/ENTITIES/mobs/api.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs/api.lua b/mods/ENTITIES/mobs/api.lua index 3b1e4c5ea7..620ed1a909 100644 --- a/mods/ENTITIES/mobs/api.lua +++ b/mods/ENTITIES/mobs/api.lua @@ -930,7 +930,17 @@ function smart_mobs(self, s, p, dist, dtime) p1.y = floor(p1.y + 0.5) p1.z = floor(p1.z + 0.5) - self.path.way = minetest.find_path(s, p1, 16, 2, 6) + local drop_height = self.fear_height + if not drop_height then + drop_height = 4 + end + local jump_height + if self.jump_height then + jump_height = math.max(1, self.jump_height/3) + else + jump_height = 1 + end + self.path.way = minetest.find_path(s, p1, self.view_range + 1, jump_height, drop_height, "A*_noprefetch") -- attempt to unstick mob that is "daydreaming" self.object:setpos({