Skip to content

Commit e533766

Browse files
committed
feat: Show the experience bar for the selected player when observing
1 parent 02fdf4f commit e533766

File tree

1 file changed

+9
-2
lines changed
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks

1 file changed

+9
-2
lines changed

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/GUI/GUICallbacks/W3DControlBar.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,16 @@ void W3DCommandBarGridDraw( GameWindow *window, WinInstanceData *instData )
486486

487487
void W3DCommandBarGenExpDraw( GameWindow *window, WinInstanceData *instData )
488488
{
489-
Player *player = ThePlayerList->getLocalPlayer();
490-
if(!player->isPlayerActive())
489+
Player* player = NULL;
490+
491+
if (TheControlBar->isObserverControlBarOn())
492+
player = TheControlBar->getObserverLookAtPlayer();
493+
else
494+
player = ThePlayerList->getLocalPlayer();
495+
496+
if (!player)
491497
return;
498+
492499
static const Image *endBar = TheMappedImageCollection->findImageByName("GenExpBarTop1");
493500
static const Image *beginBar = TheMappedImageCollection->findImageByName("GenExpBarBottom1");
494501
static const Image *centerBar = TheMappedImageCollection->findImageByName("GenExpBar1");

0 commit comments

Comments
 (0)