summaryrefslogtreecommitdiff
path: root/src/contest.c
diff options
context:
space:
mode:
authorgarak <garakmon@gmail.com>2018-11-27 13:31:07 -0500
committergarak <garakmon@gmail.com>2018-11-27 13:31:07 -0500
commit50f00b0827a4952a12f90009bd992f23c80a56af (patch)
tree6a5f78b04b42c162ed95cfc66c91a8b24f4051b2 /src/contest.c
parentf02cb667bbddf4f4a1152c86cbf9616468e7f0d2 (diff)
parentc909aa92dee0a8d202d9195d80d0cc96b0d1ebc8 (diff)
Merge remote-tracking branch 'upstream/master' into fldeff
Diffstat (limited to 'src/contest.c')
-rw-r--r--src/contest.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/contest.c b/src/contest.c
index 76e13781c..0c3a041b0 100644
--- a/src/contest.c
+++ b/src/contest.c
@@ -193,19 +193,6 @@ EWRAM_DATA struct ContestWinner gUnknown_02039F3C = {0};
u32 gContestRngValue;
-extern u16 gBattle_BG0_X;
-extern u16 gBattle_BG0_Y;
-extern u16 gBattle_BG1_X;
-extern s16 gBattle_BG1_Y;
-extern u16 gBattle_BG2_X;
-extern u16 gBattle_BG2_Y;
-extern u16 gBattle_BG3_X;
-extern u16 gBattle_BG3_Y;
-extern u16 gBattle_WIN0H;
-extern u16 gBattle_WIN0V;
-extern u16 gBattle_WIN1H;
-extern u16 gBattle_WIN1V;
-
extern const u16 gUnknown_08587C30[];
extern const struct BgTemplate gUnknown_08587F34[4];
extern const struct WindowTemplate gUnknown_08587F44[];
@@ -638,7 +625,8 @@ void sub_80D8108(u8 taskId)
gTasks[taskId].data[0]++;
break;
case 1:
- if ((gBattle_BG1_Y += 7) <= 160)
+ (s16)gBattle_BG1_Y += 7;
+ if ((s16)gBattle_BG1_Y <= 160)
break;
gTasks[taskId].data[0]++;
break;
@@ -1915,9 +1903,9 @@ void sub_80DA6B4(u8 taskId)
void sub_80DA700(u8 taskId)
{
gBattle_BG1_Y -= 7;
- if (gBattle_BG1_Y < 0)
+ if ((s16)gBattle_BG1_Y < 0)
gBattle_BG1_Y = 0;
- if (*(u16 *)&gBattle_BG1_Y == 0) // Why cast?
+ if (gBattle_BG1_Y == 0) // Why cast?
{
gTasks[taskId].func = sub_80DA740;
gTasks[taskId].data[0] = 0;