summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-06-01 13:50:42 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2017-06-01 13:50:42 +0100
commitffefd49c7bc9051235ecc2f67048ab015a8db9b4 (patch)
treed9ca0353f1acfce6f27359d2645995f50c797c4f /api.lua
parentf40d260a8175e7ddae5b977b36e5e9b3d8355b5a (diff)
tweak pathfinding
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/api.lua b/api.lua
index e649787..47e114f 100644
--- a/api.lua
+++ b/api.lua
@@ -1,9 +1,9 @@
--- Mobs Api (28th May 2017)
+-- Mobs Api (1st June 2017)
mobs = {}
mobs.mod = "redo"
-mobs.version = "20170528"
+mobs.version = "20170601"
-- Intllib
@@ -977,7 +977,11 @@ local smart_mobs = function(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, "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"
self.object:setpos({