Skip to content

Fix intermediate waypoints being pushed to the client twice - #213

Merged
Slazanger merged 1 commit into
Slazanger:masterfrom
OOOOOAO:fix/duplicate-waypoint-push
Aug 22, 2026
Merged

Slazanger merged 1 commit into
Slazanger:masterfrom
OOOOOAO:fix/duplicate-waypoint-push

Conversation

@OOOOOAO

@OOOOOAO OOOOOAO commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

The bug

Navigation.Navigate(from, to) returns a route that includes both of its endpoints. LocalCharacter.UpdateActiveRoute routes one leg per waypoint and concatenates the results, so the waypoint joining two legs lands in ActiveRoute twice — once as the tail of leg N, once as the head of leg N+1:

leg 1 : Navigate(location, WP0) -> [ L, a, b, WP0 ]
leg 2 : Navigate(WP0,      WP1) -> [ WP0, c, WP1 ]
ActiveRoute                     -> [ L, a, b, WP0, WP0, c, WP1 ]

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 ActiveRouteLength counts it twice.

The fix

When appending a leg, drop the point already at the end of ActiveRoute if 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 GateToTake for 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

  • Full solution builds clean on top of current master : 4 projects, 0 errors, 0 warnings.
  • To reproduce: set a destination from the map, then add a second waypoint. Before the change the client rejects the duplicate on every route push, and the route grid shows the joining system twice.

🤖 Generated with Claude Code

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>
@Slazanger
Slazanger merged commit 75e004e into Slazanger:master Aug 22, 2026
1 check passed
@Slazanger

Copy link
Copy Markdown
Owner

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants