Skip to content

Commit 58d7ee3

Browse files
authored
bugfix(controlbar): Fix Angry Mob selection and clearing of unit information from the Control Bar when deselecting a unit during Replay playback (#1433)
1 parent 15a7e04 commit 58d7ee3

File tree

2 files changed

+4
-10
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar
  • Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar

2 files changed

+4
-10
lines changed

Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,6 @@ void ControlBar::update( void )
14141414
populateObserverInfoWindow();
14151415

14161416
Drawable *drawToEvaluateFor = NULL;
1417-
Bool multiSelect = FALSE;
14181417
if( TheInGameUI->getSelectCount() > 1 )
14191418
{
14201419
// Attempt to isolate a Drawable here to evaluate
@@ -1423,17 +1422,15 @@ void ControlBar::update( void )
14231422
// but is represented in the UI as a single unit,
14241423
// so we must isolate and evaluate only the Nexus
14251424
drawToEvaluateFor = TheGameClient->findDrawableByID( TheInGameUI->getSoloNexusSelectedDrawableID() ) ;
1426-
multiSelect = ( drawToEvaluateFor == NULL );
1427-
14281425
}
14291426
else // get the first and only drawble in the selection list
14301427
// TheSuperHackers @fix Mauller 07/04/2025 The first access to this can return an empty list
14311428
if (!TheInGameUI->getAllSelectedDrawables()->empty()) {
14321429
drawToEvaluateFor = TheInGameUI->getAllSelectedDrawables()->front();
1433-
Object *obj = drawToEvaluateFor ? drawToEvaluateFor->getObject() : NULL;
1434-
setPortraitByObject( obj );
14351430
}
14361431

1432+
Object* obj = drawToEvaluateFor ? drawToEvaluateFor->getObject() : NULL;
1433+
setPortraitByObject(obj);
14371434
return;
14381435
}
14391436

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,6 @@ void ControlBar::update( void )
14371437
populateObserverInfoWindow();
14381438

14391439
Drawable *drawToEvaluateFor = NULL;
1440-
Bool multiSelect = FALSE;
14411440
if( TheInGameUI->getSelectCount() > 1 )
14421441
{
14431442
// Attempt to isolate a Drawable here to evaluate
@@ -1446,17 +1445,15 @@ void ControlBar::update( void )
14461445
// but is represented in the UI as a single unit,
14471446
// so we must isolate and evaluate only the Nexus
14481447
drawToEvaluateFor = TheGameClient->findDrawableByID( TheInGameUI->getSoloNexusSelectedDrawableID() ) ;
1449-
multiSelect = ( drawToEvaluateFor == NULL );
1450-
14511448
}
14521449
else // get the first and only drawble in the selection list
14531450
// TheSuperHackers @fix Mauller 07/04/2025 The first access to this can return an empty list
14541451
if (!TheInGameUI->getAllSelectedDrawables()->empty()) {
14551452
drawToEvaluateFor = TheInGameUI->getAllSelectedDrawables()->front();
1456-
Object *obj = drawToEvaluateFor ? drawToEvaluateFor->getObject() : NULL;
1457-
setPortraitByObject( obj );
14581453
}
14591454

1455+
Object* obj = drawToEvaluateFor ? drawToEvaluateFor->getObject() : NULL;
1456+
setPortraitByObject(obj);
14601457
return;
14611458
}
14621459

0 commit comments

Comments
 (0)