forked from Mineclonia/Mineclonia
Fix some mob pathfinding problems, switch to A*
This commit is contained in:
parent
cb42fbf9bc
commit
e2dd85d9e4
|
@ -841,7 +841,17 @@ local function smart_mobs(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)
|
||||||
|
|
||||||
self.path.way = minetest.find_path(s, p1, 16, 2, 6, "Dijkstra") --"A*_noprefetch")
|
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"
|
-- attempt to unstick mob that is "daydreaming"
|
||||||
self.object:setpos({
|
self.object:setpos({
|
||||||
|
|
Loading…
Reference in New Issue