From 00182005d6d94df0b4d84ee31cc50e7d604a09a1 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 30 Mar 2024 00:23:08 +0100 Subject: [PATCH] Pathfinder: Can't jump when in or on climb node --- mods/rp_pathfinder/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mods/rp_pathfinder/init.lua b/mods/rp_pathfinder/init.lua index 2583cf93..6bdac1a2 100644 --- a/mods/rp_pathfinder/init.lua +++ b/mods/rp_pathfinder/init.lua @@ -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