Mark a resumed or share-restored follow only while it starts so a later follow of the same subject is navigation again

The aircraft scene binding re-tracked with origin share-restore, which stayed on the entity: a later trackedEntityChanged for it (cockpit exit, refocus) never stamped navigation, and the aircraft lost its selection origin. Flights, military and satellites now set a transient gevRestoring mark around follow.start, and the aircraft binding resumes with the origin the aircraft was selected by.
This commit is contained in:
German Khokhlov committed 2026-11-03 23:30:10 +04:00
1 parent cbe1d841ea
commit 90d64e6916
7 files changed
+176 -41

No files matched your search

+6 -1
View File
@@ -9,6 +9,9 @@ export function createAircraftSceneBinding({
enable,
}) {
let resumeFollow = false;
// The tracked aircraft's selection origin outlives the renderer, as the
// tracking itself does.
let resumeOrigin = 'programmatic';
function removeSceneListeners() {
parts.tracking._removeClickHandler();
services.picking.unregisterPickOwner(id);
@@ -58,7 +61,7 @@ export function createAircraftSceneBinding({
parts.snapshots.presentRecords();
if (flightState._trackedIcao) {
parts.tracking._trackFlight(flightState._trackedIcao, {
origin: 'share-restore',
origin: resumeOrigin,
resume: true,
follow: resumeFollow,
});
@@ -84,6 +87,8 @@ export function createAircraftSceneBinding({
flightState._trackedCameraFrameStop?.();
flightState._trackedCameraFrameStop = null;
if (flightState._trackedEntity) {
resumeOrigin =
flightState._trackedEntity.gevSelectionOrigin ?? 'programmatic';
resumeFollow = renderer.follow.isFollowing(flightState._trackedEntity);
if (resumeFollow) renderer.follow.release();
renderer.tracked.remove(flightState._trackedEntity);