mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-24 20:03:45 +01:00
Mobs: Utilize pathfinder jumpheight properly
This commit is contained in:
parent
8be35bae53
commit
be04de084b
@ -1350,10 +1350,15 @@ local smart_mobs = function(self, s, p, dist, dtime)
|
|||||||
p1.y = floor(p1.y + 0.5)
|
p1.y = floor(p1.y + 0.5)
|
||||||
p1.z = floor(p1.z + 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
|
if self.fear_height ~= 0 then dropheight = self.fear_height end
|
||||||
|
local jumpheight = 0
|
||||||
self.path.way = minetest.find_path(s, p1, 16, self.stepheight, dropheight, "A*_noprefetch")
|
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 = ""
|
self.state = ""
|
||||||
do_attack(self, self.attack)
|
do_attack(self, self.attack)
|
||||||
|
Loading…
Reference in New Issue
Block a user