File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Generals/Code/GameEngine/Source Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1122,6 +1122,15 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
1122
1122
else
1123
1123
{
1124
1124
1125
+ Drawable *draw = TheInGameUI->getFirstSelectedDrawable ();
1126
+ if ( draw && draw->isKindOf ( KINDOF_STRUCTURE ) )
1127
+ {
1128
+ // Kris: Jan 12, 2005
1129
+ // Can't select other units if you have a structure selected. So deselect the structure to prevent
1130
+ // group force attack exploit.
1131
+ TheInGameUI->deselectAllDrawables ();
1132
+ }
1133
+
1125
1134
// no need to send two messages for selecting the same group.
1126
1135
TheMessageStream->appendMessage ((GameMessage::Type)(GameMessage::MSG_ADD_TEAM0 + group));
1127
1136
Player *player = ThePlayerList->getLocalPlayer ();
Original file line number Diff line number Diff line change @@ -5312,6 +5312,14 @@ StateReturnType AIAttackState::onEnter()
5312
5312
if (m_attackParameters && m_attackParameters->shouldExit (getMachine ()))
5313
5313
return STATE_SUCCESS;
5314
5314
5315
+ // Kris: Jan 12, 2005
5316
+ // Don't allow units under construction to attack! The selection/action manager system was responsible for preventing this
5317
+ // from ever happening, but failed in two cases which I fixed. This is an extra check to mitigate cheats.
5318
+ if ( source->testStatus ( OBJECT_STATUS_UNDER_CONSTRUCTION ) )
5319
+ {
5320
+ return STATE_FAILURE;
5321
+ }
5322
+
5315
5323
// if all of our weapons are out of ammo, can't attack.
5316
5324
// (this can happen for units which never auto-reload, like the Raptor)
5317
5325
if (source->isOutOfAmmo () && !source->isKindOf (KINDOF_PROJECTILE))
You can’t perform that action at this time.
0 commit comments