From 430b543e17e11ffba8fa27ab19a88f6041c8ac7c Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Thu, 17 Jul 2025 12:42:21 +0200 Subject: [PATCH 1/2] Synchronized aircraft takeoff. --- .../Object/Update/AIUpdate/JetAIUpdate.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp index bf339c58e6..0a98fbd989 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp @@ -1349,11 +1349,21 @@ class JetPauseBeforeTakeoffState : public AIFaceState // always call this. StateReturnType superStatus = AIFaceState::update(); - + UnsignedInt now = TheGameLogic->getFrame(); + +#if !RETAIL_COMPATIBLE_CRC + if (m_resetTimer && now >= m_whenTransfer) + { + // once we start the final wait, release the runways for guys behind us, so they can start taxiing + ParkingPlaceBehaviorInterface* pp = getPP(jet->getProducerID()); + if (pp) + pp->transferRunwayReservationToNextInLineForTakeoff(jet->getID()); + } +#endif + if (findWaiter()) return STATE_CONTINUE; - UnsignedInt now = TheGameLogic->getFrame(); if (!m_resetTimer) { // we had to wait, but now everyone else is ready, so restart our countdown. @@ -1379,12 +1389,14 @@ class JetPauseBeforeTakeoffState : public AIFaceState DEBUG_ASSERTCRASH(m_when != 0, ("hmm")); DEBUG_ASSERTCRASH(m_whenTransfer != 0, ("hmm")); - // once we start the final wait, release the runways for guys behind us, so they can start taxiing +#if RETAIL_COMPATIBLE_CRC + // once we start the final wait, release the runways for guys behind us, so they can start taxiing ParkingPlaceBehaviorInterface* pp = getPP(jet->getProducerID()); if (pp && now >= m_whenTransfer) { pp->transferRunwayReservationToNextInLineForTakeoff(jet->getID()); } +#endif if (now >= m_when) return superStatus; From 7bc0326d485fb98fc9dac5085c7e1c51ff47cb9c Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Thu, 31 Jul 2025 02:26:36 +0200 Subject: [PATCH 2/2] Simplified code. --- .../Object/Update/AIUpdate/JetAIUpdate.cpp | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp index 0a98fbd989..5c28295fba 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp @@ -1349,21 +1349,16 @@ class JetPauseBeforeTakeoffState : public AIFaceState // always call this. StateReturnType superStatus = AIFaceState::update(); - UnsignedInt now = TheGameLogic->getFrame(); - -#if !RETAIL_COMPATIBLE_CRC - if (m_resetTimer && now >= m_whenTransfer) - { - // once we start the final wait, release the runways for guys behind us, so they can start taxiing - ParkingPlaceBehaviorInterface* pp = getPP(jet->getProducerID()); - if (pp) - pp->transferRunwayReservationToNextInLineForTakeoff(jet->getID()); - } -#endif +#if RETAIL_COMPATIBLE_CRC if (findWaiter()) return STATE_CONTINUE; +#else + if (!m_resetTimer && findWaiter()) + return STATE_CONTINUE; +#endif + UnsignedInt now = TheGameLogic->getFrame(); if (!m_resetTimer) { // we had to wait, but now everyone else is ready, so restart our countdown. @@ -1389,14 +1384,12 @@ class JetPauseBeforeTakeoffState : public AIFaceState DEBUG_ASSERTCRASH(m_when != 0, ("hmm")); DEBUG_ASSERTCRASH(m_whenTransfer != 0, ("hmm")); -#if RETAIL_COMPATIBLE_CRC - // once we start the final wait, release the runways for guys behind us, so they can start taxiing + // once we start the final wait, release the runways for guys behind us, so they can start taxiing ParkingPlaceBehaviorInterface* pp = getPP(jet->getProducerID()); if (pp && now >= m_whenTransfer) { pp->transferRunwayReservationToNextInLineForTakeoff(jet->getID()); } -#endif if (now >= m_when) return superStatus;