Skip to content

Commit 309d7b8

Browse files
author
Bart Roossien
committed
[GEN]{ZH] Prevents group force attack exploit when adding a building group to a unit selection
1 parent b1f97df commit 309d7b8

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,16 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
11411141
Int numObjs = objlist.size();
11421142
for (Int i = 0; i < numObjs; ++i)
11431143
{
1144+
// TheSuperHackers @fix skyaero 22/07/2025
1145+
// Check if there is a structure in the group
1146+
// If so deselect everything to prevent group force attack exploit
1147+
Drawable* drawObj = objlist[i]->getDrawable();
1148+
if (drawObj && drawObj->isKindOf(KINDOF_STRUCTURE))
1149+
{
1150+
TheInGameUI->deselectAllDrawables();
1151+
break;
1152+
}
1153+
11441154
TheInGameUI->selectDrawable(objlist[i]->getDrawable());
11451155
}
11461156
}

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,17 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
12161216
Int numObjs = objlist.size();
12171217
for (Int i = 0; i < numObjs; ++i)
12181218
{
1219-
TheInGameUI->selectDrawable(objlist[i]->getDrawable());
1219+
// TheSuperHackers @fix skyaero 22/07/2025
1220+
// Check if there is a structure in the group
1221+
// If so deselect everything to prevent group force attack exploit
1222+
Drawable* drawObj = objlist[i]->getDrawable();
1223+
if (drawObj && drawObj->isKindOf(KINDOF_STRUCTURE))
1224+
{
1225+
TheInGameUI->deselectAllDrawables();
1226+
break;
1227+
}
1228+
1229+
TheInGameUI->selectDrawable(drawObj);
12201230
}
12211231
}
12221232
}

0 commit comments

Comments
 (0)