diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-01-26 12:23:08 -0500 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2020-01-26 12:23:08 -0500 |
commit | 9c934c966400813e8ed6c8a5c0f93fb8cdc12546 (patch) | |
tree | 8e131411fca696d59f68a0116e59751e53d2b55b /src/slot_machine.c | |
parent | 4c12ad00d21b43d0946b2a0ba3ee471af9262673 (diff) | |
parent | 9a6c2c25d08ef157cc4800014651bd0c679f6fc5 (diff) |
Merge master into fix-eventobj, add explicit size to gObjectEventGraphicsInfoPointers
Diffstat (limited to 'src/slot_machine.c')
-rw-r--r-- | src/slot_machine.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/slot_machine.c b/src/slot_machine.c index a7dcd1613..db1291ceb 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -24,6 +24,7 @@ #include "main_menu.h" #include "bg.h" #include "window.h" +#include "constants/coins.h" // Text extern const u8 gText_YouDontHaveThreeCoins[]; @@ -974,7 +975,7 @@ static bool8 SlotAction4(struct Task *task) { sub_8104CAC(0); sSlotMachine->state = 5; - if (sSlotMachine->coins >= 9999) + if (sSlotMachine->coins >= MAX_COINS) sSlotMachine->state = 23; return TRUE; } @@ -1186,8 +1187,8 @@ static bool8 SlotAction_CheckMatches(struct Task *task) { sub_8104CAC(3); sSlotMachine->state = 20; - if ((sSlotMachine->netCoinLoss += sSlotMachine->bet) > 9999) - sSlotMachine->netCoinLoss = 9999; + if ((sSlotMachine->netCoinLoss += sSlotMachine->bet) > MAX_COINS) + sSlotMachine->netCoinLoss = MAX_COINS; } return FALSE; } @@ -1693,7 +1694,7 @@ static bool8 AwardPayoutAction_GivePayoutToPlayer(struct Task *task) if (IsFanfareTaskInactive()) PlaySE(SE_PIN); sSlotMachine->payout--; - if (sSlotMachine->coins < 9999) + if (sSlotMachine->coins < MAX_COINS) sSlotMachine->coins++; task->data[1] = 8; if (gMain.heldKeys & A_BUTTON) @@ -1703,8 +1704,8 @@ static bool8 AwardPayoutAction_GivePayoutToPlayer(struct Task *task) { PlaySE(SE_PIN); sSlotMachine->coins += sSlotMachine->payout; - if (sSlotMachine->coins > 9999) - sSlotMachine->coins = 9999; + if (sSlotMachine->coins > MAX_COINS) + sSlotMachine->coins = MAX_COINS; sSlotMachine->payout = 0; } if (sSlotMachine->payout == 0) @@ -3291,9 +3292,9 @@ static void sub_8104F8C(void) s16 i; s16 x; - for (x = 203, i = 1; i < 10000; i *= 10, x -= 7) + for (x = 203, i = 1; i <= MAX_COINS; i *= 10, x -= 7) sub_8104FF4(x, 23, 0, i); - for (x = 235, i = 1; i < 10000; i *= 10, x -= 7) + for (x = 235, i = 1; i <= MAX_COINS; i *= 10, x -= 7) sub_8104FF4(x, 23, 1, i); } |