Pathfinder: Can't jump when in or on climb node

This commit is contained in:
Wuzzy 2024-03-30 00:23:08 +01:00
parent b7a85812db
commit 00182005d6

View File

@ -405,15 +405,25 @@ function rp_pathfinder.find_path(pos1, pos2, searchdistance, options, timeout)
if climbable(current_node, -1) then
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
end
current_max_jump = 0
else
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
end
else
if climbable(current_node) then
table.insert(current_neighbor_dirs, {x=0,y=1,z=0})
current_max_jump = 0
end
table.insert(current_neighbor_dirs, {x=0,y=-1,z=0})
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
-- Prevent jumping from disable_jump nodes (if enabled)
if respect_disable_jump and max_jump > 0 then