Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,16 @@ static int routeActionIndex(List<WorldPoint> path, int currentIndex,
{
return index;
}
if (reachable.contains(from) && !reachable.contains(to))
// A reachable-from / unreachable-to frontier is not, by itself, proof that an
// executable route action exists. Promoting that generic collision boundary caused
// the executor to repeatedly call runtimeHandleRouteEdge(), whose handlers could not
// identify an actual door/transport/object; replanning then selected the same edge
// again. Only catalog-backed boundaries are action edges here. Unconfirmed frontiers
// remain normal pathfinding/movement responsibility. They still terminate this
// lookahead so a later catalog transport cannot leapfrog an unresolved frontier.
if (!catalogEdge && reachable.contains(from) && !reachable.contains(to))
{
// Preserve route ordering: a later catalog transport must not leapfrog an
// unresolved door/gate/frontier that is still outside generic interaction range.
boolean genericActionInRange = index <= currentIndex + GENERIC_ROUTE_EDGE_INDEX_LOOKAHEAD
&& distance <= (catalogDoorEdge
? CATALOG_DOOR_EDGE_ACTION_DISTANCE
: GENERIC_ROUTE_EDGE_ACTION_DISTANCE);
return genericActionInRange ? index : -1;
return -1;
}
}
return -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,27 @@ public void distantGenericRouteEdgeStillAllowsCloserApproach()
}
}

@Test
public void nearbyUnconfirmedRouteFrontierDoesNotBecomeAnActionEdge()
{
WorldPoint player = new WorldPoint(3005, 3336, 0);
WorldPoint blockedEdge = new WorldPoint(3006, 3337, 0);
List<WorldPoint> path = List.of(player, blockedEdge);
PathfinderConfig previousConfig = ShortestPathPlugin.pathfinderConfig;
PathfinderConfig config = mock(PathfinderConfig.class);
when(config.getTransports()).thenReturn(new java.util.concurrent.ConcurrentHashMap<>());
try
{
ShortestPathPlugin.pathfinderConfig = config;
assertEquals("a collision frontier without a confirmed catalog action must remain ground movement",
-1, RuneLiteWebWalkRuntime.routeActionIndex(path, 0, player, Set.of(player)));
}
finally
{
ShortestPathPlugin.pathfinderConfig = previousConfig;
}
}

@Test
public void unresolvedGenericFrontierPreventsLookaheadToLaterTransport()
{
Expand Down
Loading