Skip to content

Commit b80a653

Browse files
committed
bugfix: Preserve unit behaviour when transferring assets to allies
1 parent 5de3d63 commit b80a653

File tree

2 files changed

+14
-0
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameLogic/Object
  • Generals/Code/GameEngine/Source/GameLogic/Object

2 files changed

+14
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3998,7 +3998,14 @@ void Object::onCapture( Player *oldOwner, Player *newOwner )
39983998
{
39993999
// Everybody dhills when they captured so they don't keep doing something the new player might not want him to be doing
40004000
if( getAIUpdateInterface() && (oldOwner != newOwner) )
4001+
{
4002+
#if RETAIL_COMPATIBLE_CRC
40014003
getAIUpdateInterface()->aiIdle(CMD_FROM_AI);
4004+
#else
4005+
if (oldOwner->getRelationship(newOwner->getDefaultTeam()) != ALLIES)
4006+
getAIUpdateInterface()->aiIdle(CMD_FROM_AI);
4007+
#endif
4008+
}
40024009

40034010
// this gets the new owner some points
40044011
newOwner->getScoreKeeper()->addObjectCaptured(this);

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4519,7 +4519,14 @@ void Object::onCapture( Player *oldOwner, Player *newOwner )
45194519
{
45204520
// Everybody dhills when they captured so they don't keep doing something the new player might not want him to be doing
45214521
if( getAIUpdateInterface() && (oldOwner != newOwner) )
4522+
{
4523+
#if RETAIL_COMPATIBLE_CRC
45224524
getAIUpdateInterface()->aiIdle(CMD_FROM_AI);
4525+
#else
4526+
if (oldOwner->getRelationship(newOwner->getDefaultTeam()) != ALLIES)
4527+
getAIUpdateInterface()->aiIdle(CMD_FROM_AI);
4528+
#endif
4529+
}
45234530

45244531
// this gets the new owner some points
45254532
newOwner->getScoreKeeper()->addObjectCaptured(this);

0 commit comments

Comments
 (0)