Skip to content

Commit 31b2be7

Browse files
authored
bugfix(input): Prevent dead units from blocking positional context commands (#1429)
1 parent a8826c6 commit 31b2be7

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3436,6 +3436,14 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
34363436
Drawable *draw = TheTacticalView->pickDrawable(&msg->getArgument(0)->pixelRegion.lo,
34373437
TheInGameUI->isInForceAttackMode(),
34383438
(PickType) pickType);
3439+
3440+
// TheSuperHackers @bugfix Stubbjax 07/08/2025 Prevent dead units blocking positional context commands
3441+
Object* obj = draw ? draw->getObject() : NULL;
3442+
if (!obj || (obj->isEffectivelyDead() && !obj->isKindOf(KINDOF_ALWAYS_SELECTABLE)))
3443+
{
3444+
draw = NULL;
3445+
}
3446+
34393447
if (TheInGameUI->isInForceAttackMode()) {
34403448
evaluateForceAttack( draw, &pos, DO_COMMAND );
34413449
} else {
@@ -3489,6 +3497,13 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
34893497
Drawable *draw = TheTacticalView->pickDrawable(&msg->getArgument(0)->pixelRegion.lo,
34903498
TheInGameUI->isInForceAttackMode(),
34913499
(PickType) pickType);
3500+
3501+
// TheSuperHackers @bugfix Stubbjax 07/08/2025 Prevent dead units blocking positional context commands
3502+
Object* obj = draw ? draw->getObject() : NULL;
3503+
if (!obj || (obj->isEffectivelyDead() && !obj->isKindOf(KINDOF_ALWAYS_SELECTABLE)))
3504+
{
3505+
draw = NULL;
3506+
}
34923507

34933508
if (TheInGameUI->isInForceAttackMode()) {
34943509
evaluateForceAttack( draw, &pos, DO_COMMAND );

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3804,6 +3804,14 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
38043804
Drawable *draw = TheTacticalView->pickDrawable(&msg->getArgument(0)->pixelRegion.lo,
38053805
TheInGameUI->isInForceAttackMode(),
38063806
(PickType) pickType);
3807+
3808+
// TheSuperHackers @bugfix Stubbjax 07/08/2025 Prevent dead units blocking positional context commands
3809+
Object* obj = draw ? draw->getObject() : NULL;
3810+
if (!obj || (obj->isEffectivelyDead() && !obj->isKindOf(KINDOF_ALWAYS_SELECTABLE)))
3811+
{
3812+
draw = NULL;
3813+
}
3814+
38073815
if (TheInGameUI->isInForceAttackMode()) {
38083816
evaluateForceAttack( draw, &pos, DO_COMMAND );
38093817
} else {
@@ -3875,6 +3883,13 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
38753883
Drawable *draw = TheTacticalView->pickDrawable(&msg->getArgument(0)->pixelRegion.lo,
38763884
TheInGameUI->isInForceAttackMode(),
38773885
(PickType) pickType);
3886+
3887+
// TheSuperHackers @bugfix Stubbjax 07/08/2025 Prevent dead units blocking positional context commands
3888+
Object* obj = draw ? draw->getObject() : NULL;
3889+
if (!obj || (obj->isEffectivelyDead() && !obj->isKindOf(KINDOF_ALWAYS_SELECTABLE)))
3890+
{
3891+
draw = NULL;
3892+
}
38783893

38793894
if (TheInGameUI->isInForceAttackMode()) {
38803895
evaluateForceAttack( draw, &pos, DO_COMMAND );

0 commit comments

Comments
 (0)