From f24f4cb3de5ca8b45e6dc7b82d5898eee2cce584 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 31 Dec 2020 03:26:44 +0100 Subject: [PATCH] Fix bug that accidentally removed aircraft in unboard state --- Source/Game.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Game.c b/Source/Game.c index bcc9593..d53d6f8 100644 --- a/Source/Game.c +++ b/Source/Game.c @@ -4017,9 +4017,6 @@ void GameRemoveFlight(const uint8_t idx, const bool successful) { uint8_t k; - memset(ptrPlayer->UnboardingSequence, 0, GAME_MAX_SEQUENCE_KEYS); - ptrPlayer->UnboardingSequenceIdx = 0; - for (k = 0; k < GAME_MAX_RUNWAYS; k++) { const uint16_t* const targets = AircraftGetTargets(idx); @@ -4047,6 +4044,8 @@ void GameRemoveFlight(const uint8_t idx, const bool successful) { if (FlightData.State[idx] == STATE_UNBOARDING) { + memset(ptrPlayer->UnboardingSequence, 0, GAME_MAX_SEQUENCE_KEYS); + ptrPlayer->UnboardingSequenceIdx = 0; ptrPlayer->Unboarding = false; ptrPlayer->LockTarget = false; ptrPlayer->LockedAircraft = FLIGHT_DATA_INVALID_IDX;