Repository navigation
Fix intermediate waypoints being pushed to the client twice - #213
Merged
Merged
Conversation
Navigate returns a route including both of its endpoints, so when UpdateActiveRoute stitches the legs together the waypoint joining two legs lands in ActiveRoute twice : once as the tail of leg N, once as the head of leg N+1. The ESI push list keeps every route point whose name is in Waypoints, so both copies went out, and the client refuses a waypoint that repeats the one before it -- "cannot add a waypoint to the same location", on every route with two or more waypoints. The copy dropped is the stale one, not the incoming one : only the head of leg N+1 carries the GateToTake for the next hop, so keeping the tail of leg N instead would lose the Ansiblex/Thera/Turnur/Zarzakh routing. Also skips consecutive identical ids when building the push list, which covers the other way one system can yield the same id twice : the jump bridge lookup remapping a system id to its structure id. Side effect : the route list no longer shows the joining system twice, and ActiveRouteLength no longer counts it twice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Owner
|
thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Navigation.Navigate(from, to)returns a route that includes both of its endpoints.LocalCharacter.UpdateActiveRouteroutes one leg per waypoint and concatenates the results, so the waypoint joining two legs lands inActiveRoutetwice — once as the tail of leg N, once as the head of leg N+1:The ESI push list keeps every route point whose name is in
Waypoints, so both copies of WP0 go out. The client refuses a waypoint that repeats the one before it and shows "cannot add a waypoint to the same location" — on every route with two or more waypoints.Two smaller symptoms have the same cause: the route grid lists the joining system twice, and
ActiveRouteLengthcounts it twice.The fix
When appending a leg, drop the point already at the end of
ActiveRouteif the incoming leg starts with the same system.The copy dropped is the stale one rather than the incoming one on purpose: only the head of leg N+1 carries the
GateToTakefor the next hop, so keeping the tail of leg N instead would silently lose Ansiblex / Thera / Turnur / Zarzakh routing on any waypoint the route passes through.A second, smaller guard skips consecutive identical ids while building
WayPointsToAdd. That covers the other way one system can yield the same id twice — the jump bridge lookup remapping a system id to its structure id.Testing
🤖 Generated with Claude Code