Skip to content

Commit ebec03f

Browse files
authored
[ZH] Fix broken money deposit and withdraw audio and academy income record (#1311)
Money deposits and withdrawals now trigger a beep sound
1 parent 09ca272 commit ebec03f

File tree

1 file changed

+10
-8
lines changed
  • GeneralsMD/Code/GameEngine/Source/Common/RTS

1 file changed

+10
-8
lines changed

GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,16 @@ void Player::init(const PlayerTemplate* pt)
452452

453453
if( m_money.countMoney() == 0 )
454454
{
455-
if ( TheGameInfo )
456-
{
457-
m_money = TheGameInfo->getStartingCash();
458-
}
459-
else
460-
{
461-
m_money = TheGlobalData->m_defaultStartingCash;
462-
}
455+
// TheSuperHacker @bugfix Now correctly deposits the money and fixes its audio and academy issues.
456+
// Note that copying the entire Money class instead would also copy the player index inside of it.
457+
if ( TheGameInfo )
458+
{
459+
m_money.deposit( TheGameInfo->getStartingCash().countMoney(), FALSE );
460+
}
461+
else
462+
{
463+
m_money.deposit( TheGlobalData->m_defaultStartingCash.countMoney(), FALSE );
464+
}
463465
}
464466

465467
m_playerDisplayName.clear();

0 commit comments

Comments
 (0)