Skip to content

Commit 0cbfcf9

Browse files
committed
bugfix: Prevent dead units from blocking positional context commands
1 parent f3ba422 commit 0cbfcf9

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3427,6 +3427,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
34273427
Drawable *draw = TheTacticalView->pickDrawable(&msg->getArgument(0)->pixelRegion.lo,
34283428
TheInGameUI->isInForceAttackMode(),
34293429
(PickType) pickType);
3430+
Object* obj = draw ? draw->getObject() : NULL;
3431+
if (!obj || (obj->isEffectivelyDead() && !obj->isKindOf(KINDOF_ALWAYS_SELECTABLE)))
3432+
{
3433+
draw = NULL;
3434+
}
3435+
34303436
if (TheInGameUI->isInForceAttackMode()) {
34313437
evaluateForceAttack( draw, &pos, DO_COMMAND );
34323438
} else {
@@ -3480,6 +3486,11 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
34803486
Drawable *draw = TheTacticalView->pickDrawable(&msg->getArgument(0)->pixelRegion.lo,
34813487
TheInGameUI->isInForceAttackMode(),
34823488
(PickType) pickType);
3489+
Object* obj = draw ? draw->getObject() : NULL;
3490+
if (!obj || (obj->isEffectivelyDead() && !obj->isKindOf(KINDOF_ALWAYS_SELECTABLE)))
3491+
{
3492+
draw = NULL;
3493+
}
34833494

34843495
if (TheInGameUI->isInForceAttackMode()) {
34853496
evaluateForceAttack( draw, &pos, DO_COMMAND );

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3795,6 +3795,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
37953795
Drawable *draw = TheTacticalView->pickDrawable(&msg->getArgument(0)->pixelRegion.lo,
37963796
TheInGameUI->isInForceAttackMode(),
37973797
(PickType) pickType);
3798+
Object* obj = draw ? draw->getObject() : NULL;
3799+
if (!obj || (obj->isEffectivelyDead() && !obj->isKindOf(KINDOF_ALWAYS_SELECTABLE)))
3800+
{
3801+
draw = NULL;
3802+
}
3803+
37983804
if (TheInGameUI->isInForceAttackMode()) {
37993805
evaluateForceAttack( draw, &pos, DO_COMMAND );
38003806
} else {
@@ -3866,6 +3872,11 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
38663872
Drawable *draw = TheTacticalView->pickDrawable(&msg->getArgument(0)->pixelRegion.lo,
38673873
TheInGameUI->isInForceAttackMode(),
38683874
(PickType) pickType);
3875+
Object* obj = draw ? draw->getObject() : NULL;
3876+
if (!obj || (obj->isEffectivelyDead() && !obj->isKindOf(KINDOF_ALWAYS_SELECTABLE)))
3877+
{
3878+
draw = NULL;
3879+
}
38693880

38703881
if (TheInGameUI->isInForceAttackMode()) {
38713882
evaluateForceAttack( draw, &pos, DO_COMMAND );

0 commit comments

Comments
 (0)