From b80a65364dec137997a2b6306aa89da6489df20a Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Wed, 19 Nov 2025 22:05:58 +1100 Subject: [PATCH] bugfix: Preserve unit behaviour when transferring assets to allies --- .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 7 +++++++ .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 60b5214dbc..3e17c73c0e 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -3998,7 +3998,14 @@ void Object::onCapture( Player *oldOwner, Player *newOwner ) { // Everybody dhills when they captured so they don't keep doing something the new player might not want him to be doing if( getAIUpdateInterface() && (oldOwner != newOwner) ) + { +#if RETAIL_COMPATIBLE_CRC getAIUpdateInterface()->aiIdle(CMD_FROM_AI); +#else + if (oldOwner->getRelationship(newOwner->getDefaultTeam()) != ALLIES) + getAIUpdateInterface()->aiIdle(CMD_FROM_AI); +#endif + } // this gets the new owner some points newOwner->getScoreKeeper()->addObjectCaptured(this); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index f65afacd15..b3a0485c5d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -4519,7 +4519,14 @@ void Object::onCapture( Player *oldOwner, Player *newOwner ) { // Everybody dhills when they captured so they don't keep doing something the new player might not want him to be doing if( getAIUpdateInterface() && (oldOwner != newOwner) ) + { +#if RETAIL_COMPATIBLE_CRC getAIUpdateInterface()->aiIdle(CMD_FROM_AI); +#else + if (oldOwner->getRelationship(newOwner->getDefaultTeam()) != ALLIES) + getAIUpdateInterface()->aiIdle(CMD_FROM_AI); +#endif + } // this gets the new owner some points newOwner->getScoreKeeper()->addObjectCaptured(this);