Skip to content

Commit 755835b

Browse files
committed
chore: Replicate changes in Generals
1 parent f320f47 commit 755835b

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

Generals/Code/GameEngine/Source/GameClient/Drawable.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include "GameLogic/Weapon.h"
6464

6565
#include "GameClient/Anim2D.h"
66+
#include "GameClient/ControlBar.h"
6667
#include "GameClient/Display.h"
6768
#include "GameClient/DisplayStringManager.h"
6869
#include "GameClient/Drawable.h"
@@ -2285,7 +2286,7 @@ Bool Drawable::drawsAnyUIText( void )
22852286
return FALSE;
22862287

22872288
const Object *obj = getObject();
2288-
if ( !obj || !obj->isLocallyControlled() )
2289+
if ( !obj || obj->getControllingPlayer() != TheControlBar->getCurrentlyViewedPlayer())
22892290
return FALSE;
22902291

22912292
Player *owner = obj->getControllingPlayer();
@@ -2434,7 +2435,7 @@ void Drawable::drawAmmo( const IRegion2D *healthBarRegion )
24342435
if (!(
24352436
TheGlobalData->m_showObjectHealth &&
24362437
(isSelected() || (TheInGameUI && (TheInGameUI->getMousedOverDrawableID() == getID()))) &&
2437-
obj->getControllingPlayer() == ThePlayerList->getLocalPlayer()
2438+
obj->getControllingPlayer() == TheControlBar->getCurrentlyViewedPlayer()
24382439
))
24392440
return;
24402441

@@ -2492,7 +2493,7 @@ void Drawable::drawContained( const IRegion2D *healthBarRegion )
24922493
if (!(
24932494
TheGlobalData->m_showObjectHealth &&
24942495
(isSelected() || (TheInGameUI && (TheInGameUI->getMousedOverDrawableID() == getID()))) &&
2495-
obj->getControllingPlayer() == ThePlayerList->getLocalPlayer()
2496+
obj->getControllingPlayer() == TheControlBar->getCurrentlyViewedPlayer()
24962497
))
24972498
return;
24982499

@@ -2965,7 +2966,7 @@ void Drawable::drawBombed(const IRegion2D* healthBarRegion)
29652966
UnsignedInt now = TheGameLogic->getFrame();
29662967

29672968
if( obj->testWeaponSetFlag( WEAPONSET_CARBOMB ) &&
2968-
obj->getControllingPlayer() == ThePlayerList->getLocalPlayer())
2969+
obj->getControllingPlayer() == TheControlBar->getCurrentlyViewedPlayer())
29692970
{
29702971
if( !getIconInfo()->m_icon[ ICON_CARBOMB ] )
29712972
getIconInfo()->m_icon[ ICON_CARBOMB ] = newInstance(Anim2D)( s_animationTemplates[ ICON_CARBOMB ], TheAnim2DCollection );

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,18 @@ void ControlBar::update( void )
14381438

14391439
Object* obj = drawToEvaluateFor ? drawToEvaluateFor->getObject() : NULL;
14401440
setPortraitByObject(obj);
1441+
1442+
if (obj && obj->getControllingPlayer() == getCurrentlyViewedPlayer())
1443+
{
1444+
ExitInterface* exit = obj->getObjectExitInterface();
1445+
if (exit)
1446+
showRallyPoint(exit->getRallyPoint());
1447+
else
1448+
showRallyPoint(NULL);
1449+
}
1450+
else
1451+
showRallyPoint(NULL);
1452+
14411453
return;
14421454
}
14431455

@@ -2716,7 +2728,9 @@ void ControlBar::showRallyPoint( const Coord3D *loc )
27162728
marker->setOrientation( TheGlobalData->m_downwindAngle );//To blow down wind -- ML
27172729

27182730
// set the marker colors to that of the local player
2719-
Player *player = ThePlayerList->getLocalPlayer();
2731+
Player* player = TheControlBar->getCurrentlyViewedPlayer();
2732+
if (!player)
2733+
return;
27202734

27212735
if (TheGlobalData->m_timeOfDay == TIME_OF_DAY_NIGHT)
27222736
marker->setIndicatorColor( player->getPlayerNightColor() );

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include "Common/ThingFactory.h"
6464
#include "Common/ThingTemplate.h"
6565

66+
#include "GameClient/ControlBar.h"
6667
#include "GameClient/Drawable.h"
6768
#include "GameClient/GameClient.h"
6869
#include "GameClient/InGameUI.h"
@@ -224,7 +225,7 @@ void W3DWaypointBuffer::drawWaypoints(RenderInfoClass &rinfo)
224225
Int numPoints = 0;
225226
if( obj )
226227
{
227-
if ( ! obj->isLocallyControlled())
228+
if ( obj->getControllingPlayer() != TheControlBar->getCurrentlyViewedPlayer())
228229
continue;
229230

230231
ExitInterface *exitInterface = obj->getObjectExitInterface();

0 commit comments

Comments
 (0)