Pathfinder: Fix indentation.
Improve path decorator to avoid jumping NPCs (in Minetest 0.5-dev)
This commit is contained in:
parent
70fd62825c
commit
866b25c63c
@ -32,7 +32,7 @@ npc.pathfinder.nodes = {
|
||||
-- This function is used to determine if a node is walkable
|
||||
-- or openable, in which case is good to use when finding a path
|
||||
function pathfinder.is_good_node(node, exceptions)
|
||||
--local function is_good_node(node, exceptions)
|
||||
--local function is_good_node(node, exceptions)
|
||||
-- Is openable is to support doors, fence gates and other
|
||||
-- doors from other mods. Currently, default doors, gates
|
||||
-- and cottages doors are supported.
|
||||
@ -63,7 +63,8 @@ function pathfinder.get_decorated_path(path)
|
||||
local path_detail = {}
|
||||
for i = 1, #path do
|
||||
local node = minetest.get_node(path[i])
|
||||
table.insert(path_detail, {pos=path[i], type=pathfinder.is_good_node(node, {})})
|
||||
table.insert(path_detail, {pos={x=path[i].x, y=path[i].y-0.5, z=path[i].z},
|
||||
type=pathfinder.is_good_node(node, {})})
|
||||
end
|
||||
|
||||
npc.log("DEBUG", "Detailed path: "..dump(path_detail))
|
||||
|
Loading…
Reference in New Issue
Block a user