From 87a61ed4c16d66766efd9aee33ec6f4234e44c52 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Wed, 19 Nov 2025 22:32:30 +1100 Subject: [PATCH 1/2] bugfix: Preserve occupants when transferring assets to allies --- .../Source/GameLogic/Object/Contain/TransportContain.cpp | 5 +++++ .../Source/GameLogic/Object/Contain/TransportContain.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp index 2916b521585..b063a99557d 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp @@ -503,7 +503,12 @@ void TransportContain::onCapture( Player *oldOwner, Player *newOwner ) else { //Use standard +#if RETAIL_COMPATIBLE_CRC orderAllPassengersToExit( CMD_FROM_AI ); +#else + if (oldOwner->getRelationship(newOwner->getDefaultTeam()) != ALLIES) + orderAllPassengersToExit(CMD_FROM_AI); +#endif } } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp index e024d449da9..4a845279d41 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp @@ -644,7 +644,12 @@ void TransportContain::onCapture( Player *oldOwner, Player *newOwner ) else { //Use standard +#if RETAIL_COMPATIBLE_CRC orderAllPassengersToExit( CMD_FROM_AI, FALSE ); +#else + if (oldOwner->getRelationship(newOwner->getDefaultTeam()) != ALLIES) + orderAllPassengersToExit(CMD_FROM_AI, FALSE); +#endif } } } From 525bbe9d247afcf55274a355c5fbc1b8607397a8 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Wed, 19 Aug 2026 13:55:55 +1000 Subject: [PATCH 2/2] docs: Add comments --- .../Source/GameLogic/Object/Contain/TransportContain.cpp | 1 + .../Source/GameLogic/Object/Contain/TransportContain.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp index b063a99557d..3bb7185f97d 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp @@ -506,6 +506,7 @@ void TransportContain::onCapture( Player *oldOwner, Player *newOwner ) #if RETAIL_COMPATIBLE_CRC orderAllPassengersToExit( CMD_FROM_AI ); #else + // TheSuperHackers @bugfix Stubbjax 20/11/2025 Only eject passengers if the new owner is not allied with the old owner. if (oldOwner->getRelationship(newOwner->getDefaultTeam()) != ALLIES) orderAllPassengersToExit(CMD_FROM_AI); #endif diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp index 4a845279d41..ab36cc97709 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/TransportContain.cpp @@ -647,6 +647,7 @@ void TransportContain::onCapture( Player *oldOwner, Player *newOwner ) #if RETAIL_COMPATIBLE_CRC orderAllPassengersToExit( CMD_FROM_AI, FALSE ); #else + // TheSuperHackers @bugfix Stubbjax 20/11/2025 Only eject passengers if the new owner is not allied with the old owner. if (oldOwner->getRelationship(newOwner->getDefaultTeam()) != ALLIES) orderAllPassengersToExit(CMD_FROM_AI, FALSE); #endif