Skip to content

Commit 86f9461

Browse files
committed
refactor: Simplify conditions
1 parent 4220a07 commit 86f9461

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,7 @@ UpdateSleepTime AutoDepositUpdate::update( void )
173173
getObject()->getControllingPlayer()->getScoreKeeper()->addMoneyEarned( modData->m_depositAmount);
174174
}
175175

176-
Bool displayMoney = moneyAmount > 0 ? TRUE : FALSE;
177-
if (!getObject()->getDrawable()->isVisible())
178-
displayMoney = FALSE;
179-
180-
if( displayMoney )
176+
if (moneyAmount > 0 && getObject()->getDrawable()->isVisible())
181177
{
182178

183179
const Object *owner = getObject();

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,7 @@ Bool SupplyCenterDockUpdate::action( Object* docker, Object *drone )
129129
}
130130
}
131131

132-
Bool displayMoney = value > 0 ? TRUE : FALSE;
133-
if (!getObject()->getDrawable()->isVisible())
134-
displayMoney = FALSE;
135-
136-
if( displayMoney )
132+
if (value > 0 && getObject()->getDrawable()->isVisible())
137133
{
138134
// OY LOOK! I AM USING LOCAL PLAYER. Do not put anything other than TheInGameUI->addFloatingText in the block this controls!!!
139135
// Setup info for adding a floating text

0 commit comments

Comments
 (0)