aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-12-31 03:26:44 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2021-01-01 04:39:17 +0100
commitf24f4cb3de5ca8b45e6dc7b82d5898eee2cce584 (patch)
treee082650bb867f86585faea5b78c4ef273f43db68
parentcb6dcac4ed7d993b0ab0f064ab3a73ed652b26a0 (diff)
Fix bug that accidentally removed aircraft in unboard state
-rw-r--r--Source/Game.c5
1 files 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;