diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-08-16 05:59:10 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2020-08-16 05:59:10 -0400 |
commit | 65bd2faf9460d4e5986c30e54b283d7674d77c55 (patch) | |
tree | 250c345d17b8d8f910d327d98f577afddfb3a64a /src/bike.c | |
parent | 2749948eebe65aa8b55738d820e4a0252dd45c1a (diff) | |
parent | 25f45ffa8441b0f0a999355c9755782ccb4809dc (diff) |
Merge branch 'master' of https://github.com/pret/pokeemerald into doc-contest
Diffstat (limited to 'src/bike.c')
-rw-r--r-- | src/bike.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bike.c b/src/bike.c index cd24d2487..5cdf066a9 100644 --- a/src/bike.c +++ b/src/bike.c @@ -7,7 +7,6 @@ #include "metatile_behavior.h" #include "overworld.h" #include "sound.h" -#include "constants/flags.h" #include "constants/map_types.h" #include "constants/songs.h" @@ -836,7 +835,7 @@ static void Bike_UpdateDirTimerHistory(u8 dir) gPlayerAvatar.directionHistory = (gPlayerAvatar.directionHistory << 4) | (dir & 0xF); - for (i = 7; i != 0; i--) + for (i = ARRAY_COUNT(gPlayerAvatar.dirTimerHistory) - 1; i != 0; i--) gPlayerAvatar.dirTimerHistory[i] = gPlayerAvatar.dirTimerHistory[i - 1]; gPlayerAvatar.dirTimerHistory[0] = 1; } @@ -847,7 +846,7 @@ static void Bike_UpdateABStartSelectHistory(u8 input) gPlayerAvatar.abStartSelectHistory = (gPlayerAvatar.abStartSelectHistory << 4) | (input & 0xF); - for (i = 7; i != 0; i--) + for (i = ARRAY_COUNT(gPlayerAvatar.abStartSelectTimerHistory) - 1; i != 0; i--) gPlayerAvatar.abStartSelectTimerHistory[i] = gPlayerAvatar.abStartSelectTimerHistory[i - 1]; gPlayerAvatar.abStartSelectTimerHistory[0] = 1; } @@ -1001,10 +1000,10 @@ void BikeClearState(int newDirHistory, int newAbStartHistory) gPlayerAvatar.directionHistory = newDirHistory; gPlayerAvatar.abStartSelectHistory = newAbStartHistory; - for (i = 0; i < 8; i++) + for (i = 0; i < ARRAY_COUNT(gPlayerAvatar.dirTimerHistory); i++) gPlayerAvatar.dirTimerHistory[i] = 0; - for (i = 0; i < 8; i++) + for (i = 0; i < ARRAY_COUNT(gPlayerAvatar.abStartSelectTimerHistory); i++) gPlayerAvatar.abStartSelectTimerHistory[i] = 0; } |