Skip to content

Commit 0a77180

Browse files
authored
bugfix(selection): Prevent exploits from grouping structures and units (#1347)
1 parent 63bfe15 commit 0a77180

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,13 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
11421142
{
11431143
VecObjectPtr objlist = selectedSquad->getLiveObjects();
11441144
Int numObjs = objlist.size();
1145+
1146+
// TheSuperHackers @bugfix skyaero 22/07/2025 Can't select other units if you have a structure selected. So deselect the structure to prevent group force attack exploit.
1147+
if (numObjs > 0 && objlist[0]->getDrawable()->isKindOf(KINDOF_STRUCTURE))
1148+
{
1149+
TheInGameUI->deselectAllDrawables();
1150+
}
1151+
11451152
for (Int i = 0; i < numObjs; ++i)
11461153
{
11471154
TheInGameUI->selectDrawable(objlist[i]->getDrawable());

GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,13 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
12171217
{
12181218
VecObjectPtr objlist = selectedSquad->getLiveObjects();
12191219
Int numObjs = objlist.size();
1220+
1221+
// TheSuperHackers @bugfix skyaero 22/07/2025 Can't select other units if you have a structure selected. So deselect the structure to prevent group force attack exploit.
1222+
if (numObjs > 0 && objlist[0]->getDrawable()->isKindOf(KINDOF_STRUCTURE))
1223+
{
1224+
TheInGameUI->deselectAllDrawables();
1225+
}
1226+
12201227
for (Int i = 0; i < numObjs; ++i)
12211228
{
12221229
TheInGameUI->selectDrawable(objlist[i]->getDrawable());

0 commit comments

Comments
 (0)