From 589479ba56b7705b4dc5f2ac096a4aa994879a4f Mon Sep 17 00:00:00 2001 From: Davide Passoni Date: Wed, 26 Mar 2025 10:15:10 +0100 Subject: [PATCH] fix: Aligned tanker orbit behaviour --- backend/core/src/airunit.cpp | 4 ++-- frontend/react/src/unit/unit.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/backend/core/src/airunit.cpp b/backend/core/src/airunit.cpp index c410e803..baa33bb0 100644 --- a/backend/core/src/airunit.cpp +++ b/backend/core/src/airunit.cpp @@ -154,8 +154,8 @@ void AirUnit::AIloop() { srand(static_cast(time(NULL)) + ID); - /* Reset the anchor, but only if the unit is not a tanker or a AWACS */ - if (state != State::IDLE && !isActiveTanker && !isActiveAWACS) { + /* Reset the anchor */ + if (state != State::IDLE) { setRacetrackAnchor(Coords(NULL)); setRacetrackBearing(NULL); setRacetrackLength(NULL); diff --git a/frontend/react/src/unit/unit.ts b/frontend/react/src/unit/unit.ts index 6006026b..09c6ddf0 100644 --- a/frontend/react/src/unit/unit.ts +++ b/frontend/react/src/unit/unit.ts @@ -1947,9 +1947,6 @@ export abstract class Unit extends CustomMarker { points.push(new LatLng(destination.lat, destination.lng)); } - /* Add racetrack anchor to the path, but only if we are an active tanker or AWACS */ - if (this.getState() !== UnitState.IDLE && (this.getIsActiveAWACS() || this.getIsActiveTanker())) points.push(this.#racetrackAnchor); - this.#pathPolyline.setLatLngs(points); if (points.length == 1) this.#clearPath();