Pathfinder: Can't jump when in or on climb node
This commit is contained in:
parent
b7a85812db
commit
00182005d6
@ -405,15 +405,25 @@ function rp_pathfinder.find_path(pos1, pos2, searchdistance, options, timeout)
|
|||||||
if climbable(current_node, -1) then
|
if climbable(current_node, -1) then
|
||||||
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
|
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
|
||||||
end
|
end
|
||||||
|
current_max_jump = 0
|
||||||
else
|
else
|
||||||
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
|
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if climbable(current_node) then
|
if climbable(current_node) then
|
||||||
table.insert(current_neighbor_dirs, {x=0,y=1,z=0})
|
table.insert(current_neighbor_dirs, {x=0,y=1,z=0})
|
||||||
|
current_max_jump = 0
|
||||||
end
|
end
|
||||||
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
|
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if current_max_jump > 0 then
|
||||||
|
local below_pos = vector.offset(current_pos, 0, -1, 0)
|
||||||
|
local below_node = get_node(below_pos)
|
||||||
|
if climbable(below_node) then
|
||||||
|
current_max_jump = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- Prevent jumping from disable_jump nodes (if enabled)
|
-- Prevent jumping from disable_jump nodes (if enabled)
|
||||||
if respect_disable_jump and max_jump > 0 then
|
if respect_disable_jump and max_jump > 0 then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user