mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 18:20:20 +01:00
tweak pathfinding
This commit is contained in:
parent
f40d260a81
commit
ffefd49c7b
10
api.lua
10
api.lua
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
-- Mobs Api (28th May 2017)
|
-- Mobs Api (1st June 2017)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20170528"
|
mobs.version = "20170601"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -977,7 +977,11 @@ 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)
|
||||||
|
|
||||||
self.path.way = minetest.find_path(s, p1, 16, 2, 6, "Dijkstra")
|
local dropheight = 10
|
||||||
|
if self.fear_height ~= 0 then dropheight = self.fear_height end
|
||||||
|
|
||||||
|
-- self.path.way = minetest.find_path(s, p1, 16, 2, 6, "Dijkstra") -- "A*_noprefetch"
|
||||||
|
self.path.way = minetest.find_path(s, p1, 16, self.stepheight, dropheight, "Dijkstra")
|
||||||
|
|
||||||
-- 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
Block a user