diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index aa60a4139d..45e7bd8c21 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -1105,6 +1105,15 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa else { + Drawable *draw = TheInGameUI->getFirstSelectedDrawable(); + if( draw && draw->isKindOf( KINDOF_STRUCTURE ) ) + { + //Kris: Jan 12, 2005 + //Can't select other units if you have a structure selected. So deselect the structure to prevent + //group force attack exploit. + TheInGameUI->deselectAllDrawables(); + } + // no need to send two messages for selecting the same group. TheMessageStream->appendMessage((GameMessage::Type)(GameMessage::MSG_ADD_TEAM0 + group)); Player *player = ThePlayerList->getLocalPlayer(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index b5c71fbba5..d1ea15ec71 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -5263,6 +5263,14 @@ StateReturnType AIAttackState::onEnter() if (m_attackParameters && m_attackParameters->shouldExit(getMachine())) return STATE_SUCCESS; + + //Kris: Jan 12, 2005 + //Don't allow units under construction to attack! The selection/action manager system was responsible for preventing this + //from ever happening, but failed in two cases which I fixed. This is an extra check to mitigate cheats. + if( source->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION ) ) + { + return STATE_FAILURE; + } // if all of our weapons are out of ammo, can't attack. // (this can happen for units which never auto-reload, like the Raptor) if (source->isOutOfAmmo() && !source->isKindOf(KINDOF_PROJECTILE))