From c3fd2722caebfeeb011dbe184b3d2c067b1b129f Mon Sep 17 00:00:00 2001 From: Bart Roossien Date: Tue, 22 Jul 2025 22:37:02 +0200 Subject: [PATCH] [GEN][ZH] Prevents group force attack exploit when adding a building group to a unit selection --- .../Source/GameClient/MessageStream/SelectionXlat.cpp | 7 +++++++ .../Source/GameClient/MessageStream/SelectionXlat.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index 9998b74522..8594bcb986 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -1141,6 +1141,13 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa { VecObjectPtr objlist = selectedSquad->getLiveObjects(); Int numObjs = objlist.size(); + + // 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. + if (numObjs > 0 && objlist[0]->getDrawable()->isKindOf(KINDOF_STRUCTURE)) + { + TheInGameUI->deselectAllDrawables(); + } + for (Int i = 0; i < numObjs; ++i) { TheInGameUI->selectDrawable(objlist[i]->getDrawable()); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp index e61b7684f1..c023b9cb73 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp @@ -1216,6 +1216,13 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa { VecObjectPtr objlist = selectedSquad->getLiveObjects(); Int numObjs = objlist.size(); + + // 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. + if (numObjs > 0 && objlist[0]->getDrawable()->isKindOf(KINDOF_STRUCTURE)) + { + TheInGameUI->deselectAllDrawables(); + } + for (Int i = 0; i < numObjs; ++i) { TheInGameUI->selectDrawable(objlist[i]->getDrawable());