diff options
author | Marcus Huderle <huderlem@gmail.com> | 2018-06-25 18:15:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 18:15:58 -0500 |
commit | fa0e1ca4de35c9723a0972efeb6f7de4dca25594 (patch) | |
tree | 0cd68b160fa8d4a27cd65d6ffa80159b231f715c /src/contest.c | |
parent | f839afb24aa2c7b70e9c28a5c069aacc46993099 (diff) | |
parent | 605f8ac1141daf66d3428923e004f82f5a5e1594 (diff) |
Merge pull request #552 from PikalaxALT/contest_link_80C2020
[DO NOT MERGE] Contest results tasks
Diffstat (limited to 'src/contest.c')
-rw-r--r-- | src/contest.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/src/contest.c b/src/contest.c index 9dff08ea7..78e2da3c0 100644 --- a/src/contest.c +++ b/src/contest.c @@ -48,23 +48,10 @@ extern u8 gBankAttacker; extern u8 gBankTarget; extern u8 gBanksBySide[]; extern u8 gBankSpriteIds[]; -extern u16 gBattle_BG3_X; -extern s16 gBattle_BG1_Y; -extern u16 gBattle_BG3_Y; -extern u16 gBattle_WIN1H; extern struct Window gUnknown_03004210; -extern u16 gBattle_WIN0V; -extern u16 gBattle_WIN1V; -extern u16 gBattle_BG2_Y; -extern u16 gBattle_BG2_X; -extern u16 gBattle_BG0_Y; -extern u16 gBattle_BG0_X; -extern u16 gBattle_BG1_X; -extern u16 gBattle_WIN0H; +extern u32 gContestRngValue; extern struct SpriteTemplate gUnknown_02024E8C; - - extern const struct ContestPokemon gContestOpponents[60]; extern const u8 gUnknown_083CA308[][2]; extern const u8 gUnknown_083CA310[][2]; @@ -583,8 +570,7 @@ void sub_80AB9A0(u8 taskId) gTasks[taskId].data[0]++; break; case 1: - gBattle_BG1_Y += 7; - if (gBattle_BG1_Y <= 160) + if ((s16)(gBattle_BG1_Y += 7) <= 160) break; gTasks[taskId].data[0]++; break; @@ -2021,10 +2007,9 @@ void sub_80ADE54(u8 taskId) void sub_80ADEAC(u8 taskId) { - gBattle_BG1_Y -= 7; - if (gBattle_BG1_Y < 0) + if ((s16)(gBattle_BG1_Y -= 7) < 0) gBattle_BG1_Y = 0; - if (*(u16 *)&gBattle_BG1_Y == 0) // Why cast? + if (gBattle_BG1_Y == 0) // Why cast? { gTasks[taskId].func = sub_80ADEEC; gTasks[taskId].data[0] = 0; @@ -5177,10 +5162,9 @@ void sub_80B237C(u8 taskId) void sub_80B23BC(u8 taskId) { - gBattle_BG1_Y -= 7; - if (gBattle_BG1_Y < 0) + if ((s16)(gBattle_BG1_Y -= 7) < 0) gBattle_BG1_Y = 0; - if (*(u16 *)&gBattle_BG1_Y == 0) // Why cast? + if (gBattle_BG1_Y == 0) // Why cast? { gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = 0; @@ -5240,8 +5224,7 @@ void sub_80B2400(u8 taskId) void sub_80B2508(u8 taskId) { - gBattle_BG1_Y += 7; - if (gBattle_BG1_Y > DISPLAY_HEIGHT) + if ((s16)(gBattle_BG1_Y += 7) > DISPLAY_HEIGHT) gTasks[taskId].func = sub_80ADCDC; } |