summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-05-23 19:19:40 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-05-23 19:19:40 +0100
commitc6d4b957686ca97748ba1145274fea4c0eef1759 (patch)
tree9c84ed5fa14feeb31d6a1193bc6b30d3cd609614 /api.lua
parente4a919da02e23a54d68a03312b5b893c1040bbb2 (diff)
tweaked pathfinding with 2 modes, 1 to find, 2 to build/break
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/api.lua b/api.lua
index ab2b37c..a8aa12c 100644
--- a/api.lua
+++ b/api.lua
@@ -14,7 +14,6 @@ local remove_far = minetest.setting_getbool("remove_far_mobs")
-- pathfinding settings
local enable_pathfinding = true
-local enable_pathfind_digging = false
local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching
local stuck_path_timeout = 10 -- how long will mob follow path before giving up
@@ -811,10 +810,9 @@ function smart_mobs(self, s, p, dist, dtime)
if not self.path.way then
self.path.following = false
--- self.path.stuck = true
-- lets make way by digging/building if not accessible
- if enable_pathfind_digging then
+ if self.pathfinding == 2 then
-- add block and remove one block above so
-- there is room to jump if needed