Skip to content

Commit

Permalink
Fixed "money may be used uninitialized" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
laserXdolphin committed Aug 29, 2024
1 parent 57b2bef commit d0ba200
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -7754,11 +7754,14 @@ static void Cmd_getmoneyreward(void)

u32 money;
u8 sPartyLevel = 1;
u8 b_buff_number = 5;

if (gBattleOutcome == B_OUTCOME_WON)
{
if (VarGet(gSpecialVar_0x8003) == 1)
{
money = gSpecialVar_0x8004;
b_buff_number = 3;
GiveFrontierBattlePoints();
}
else{
Expand Down Expand Up @@ -7791,12 +7794,11 @@ static void Cmd_getmoneyreward(void)

if (VarGet(gSpecialVar_0x8003) == 1)
{
PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 3, gSpecialVar_0x8004);
gSpecialVar_0x8003 = 0;
gSpecialVar_0x8004 = 0;}
else{
PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, money);
gSpecialVar_0x8004 = 0;
}

PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, b_buff_number, money);
gBattlescriptCurrInstr = cmd->nextInstr;
}

Expand Down

0 comments on commit d0ba200

Please sign in to comment.