diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index ea3fad05c5..9998b74522 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -1122,6 +1122,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 990c680be9..11ed2c4e11 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -5312,6 +5312,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))