Skip to content

fix(nav): a graph rebuild snaps a mid-segment walker to its destination #60

Closed

Description

@leonardomag31-lab

What happens

When the movement graph is rebuilt while an entity is partway along a segment, the entity jumps straight to its destination node in a single frame. It still arrives, so a test that only checks arrival won't catch it.

Found by @alexandrecalvao while reviewing #59 (2026-10-12):

Why

A graph rebuild clears the live routes and then restores the saved Navigating orders. navigate resolves the actor's current position to the nearest node. If that nearest node is also the destination, the from_node == to_node branch puts the actor straight onto it (src/nav/controller.zig, lines 550–569).

Expected

Rebuilding the graph should keep the in-flight segment and the actor's progress along it, or work them out again. An actor midway along a segment shouldn't be moved straight onto the destination node.

Why it matters

Flying Platform's opening cinematic walks the arriving crew down a diagonal link (flying-platform-labelle#1031). Any node that spawns or despawns during that walk causes a visible jump.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions