diff --git a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp index c9016d189ad..582f4cdb923 100644 --- a/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/Generals/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -1518,6 +1518,9 @@ Object *Team::getTeamTargetObject() return nullptr; } Object *target = TheGameLogic->findObjectByID(m_commonAttackTarget); + if (target && target->isDestroyed()) { + target = nullptr; + } if (target) { //If the enemy unit is stealthed and not detected, then we can't attack it! if( target->testStatus( OBJECT_STATUS_STEALTHED ) && diff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp index 30c8f077215..5d25a3b9e8f 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Team.cpp @@ -1519,6 +1519,9 @@ Object *Team::getTeamTargetObject() return nullptr; } Object *target = TheGameLogic->findObjectByID(m_commonAttackTarget); + if (target && target->isDestroyed()) { + target = nullptr; + } if (target) { //If the enemy unit is stealthed and not detected, then we can't attack it! if( target->testStatus( OBJECT_STATUS_STEALTHED ) &&