Skip to content

Fix NaturalDriver crash when running without a ScenarioPlayer - #828

Open
kosuke55 wants to merge 2 commits into
esmini:devfrom
kosuke55:fix/natural-driver-null-player
Open

Fix NaturalDriver crash when running without a ScenarioPlayer #828
kosuke55 wants to merge 2 commits into
esmini:devfrom
kosuke55:fix/natural-driver-null-player

Conversation

@kosuke55

@kosuke55 kosuke55 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This reports the issue and proposes a possible fix. I’m happy to follow whichever approach the maintainers prefer.

ControllerNaturalDriver::Step() injects lane changes via player_->player_server_, which is nullptr in headless library mode (e.g. esminiJS drives the ScenarioEngine directly). The first lane change in highway_driver.xosc then crashes.

Fix: add a generic ScenarioEngine::AddInjectedAction(OSCAction*) backed by an engine-owned list, used when no PlayerServer list is registered. The controller builds the LatLaneChangeAction and injects it through this entry point when no player exists. The native path is unchanged (PlayerBase/ untouched).

Includes a unit test that crashes without the fix.

@kosuke55
kosuke55 force-pushed the fix/natural-driver-null-player branch from 5822e87 to 1e0806e Compare July 28, 2026 15:07
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.

1 participant