Skip to content

Commit c9b32b2

Browse files
authored
bugfix(module): Show cash amounts of stealthed objects for allies and observers (#1858)
1 parent 524a9c6 commit c9b32b2

File tree

3 files changed

+5
-42
lines changed

3 files changed

+5
-42
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -543,25 +543,7 @@ StateReturnType HackInternetState::update()
543543
//Grant the unit some experience for a successful hack.
544544
xp->addExperiencePoints( ai->getXpPerCashUpdate() );
545545

546-
Bool displayMoney = TRUE;
547-
if( owner->testStatus(OBJECT_STATUS_STEALTHED) )
548-
{
549-
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
550-
if( !owner->isLocallyControlled() && !owner->testStatus(OBJECT_STATUS_DETECTED) )
551-
{
552-
displayMoney = FALSE;
553-
}
554-
}
555-
if( owner->getContainedBy() && owner->getContainedBy()->testStatus(OBJECT_STATUS_STEALTHED) )
556-
{
557-
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
558-
if( !owner->getContainedBy()->isLocallyControlled() && !owner->getContainedBy()->testStatus(OBJECT_STATUS_DETECTED) )
559-
{
560-
displayMoney = FALSE;
561-
}
562-
}
563-
564-
if( displayMoney )
546+
if (owner->getDrawable()->isVisible())
565547
{
566548
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
567549
//Display cash income floating over the hacker.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AutoDepositUpdate.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include "GameLogic/Module/AutoDepositUpdate.h"
6464
#include "GameLogic/Module/AIUpdate.h"
6565
#include "GameLogic/Object.h"
66+
#include "GameClient/Drawable.h"
6667
#include "GameClient/InGameUI.h"
6768
#include "GameClient/Color.h"
6869
#include "GameClient/GameText.h"
@@ -172,18 +173,7 @@ UpdateSleepTime AutoDepositUpdate::update( void )
172173
getObject()->getControllingPlayer()->getScoreKeeper()->addMoneyEarned( modData->m_depositAmount);
173174
}
174175

175-
Bool displayMoney = moneyAmount > 0 ? TRUE : FALSE;
176-
if( getObject()->testStatus(OBJECT_STATUS_STEALTHED) )
177-
{
178-
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
179-
if( !getObject()->isLocallyControlled() && !getObject()->testStatus(OBJECT_STATUS_DETECTED) )
180-
{
181-
displayMoney = FALSE;
182-
}
183-
184-
}
185-
186-
if( displayMoney )
176+
if (moneyAmount > 0 && getObject()->getDrawable()->isVisible())
187177
{
188178

189179
const Object *owner = getObject();

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/SupplyCenterDockUpdate.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "GameLogic/Module/SupplyCenterDockUpdate.h"
3535
#include "GameLogic/Module/SupplyTruckAIUpdate.h"
3636
#include "GameClient/Color.h"
37+
#include "GameClient/Drawable.h"
3738
#include "GameClient/InGameUI.h"
3839
#include "GameClient/GameText.h"
3940

@@ -128,17 +129,7 @@ Bool SupplyCenterDockUpdate::action( Object* docker, Object *drone )
128129
}
129130
}
130131

131-
Bool displayMoney = value > 0 ? TRUE : FALSE;
132-
if( getObject()->testStatus(OBJECT_STATUS_STEALTHED) )
133-
{
134-
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
135-
if( !getObject()->isLocallyControlled() && !getObject()->testStatus(OBJECT_STATUS_DETECTED) )
136-
{
137-
displayMoney = FALSE;
138-
}
139-
}
140-
141-
if( displayMoney )
132+
if (value > 0 && getObject()->getDrawable()->isVisible())
142133
{
143134
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
144135
// Setup info for adding a floating text

0 commit comments

Comments
 (0)