From be04de084bf87178b05fe228febc70566272207e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 30 Jan 2020 01:36:08 +0100 Subject: [PATCH] Mobs: Utilize pathfinder jumpheight properly --- mods/ENTITIES/mcl_mobs/api.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 9ca5461816..36e6a945ba 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1350,10 +1350,15 @@ local smart_mobs = function(self, s, p, dist, dtime) p1.y = floor(p1.y + 0.5) p1.z = floor(p1.z + 0.5) - local dropheight = 6 + local dropheight = 12 if self.fear_height ~= 0 then dropheight = self.fear_height end - - self.path.way = minetest.find_path(s, p1, 16, self.stepheight, dropheight, "A*_noprefetch") + local jumpheight = 0 + if self.jump and self.jump_height >= 4 then + jumpheight = math.min(math.ceil(self.jump_height / 4), 4) + elseif self.stepheight > 0.5 then + jumpheight = 1 + end + self.path.way = minetest.find_path(s, p1, 16, jumpheight, dropheight, "A*_noprefetch") self.state = "" do_attack(self, self.attack)