summaryrefslogtreecommitdiff
path: root/src/vs_seeker.c
diff options
context:
space:
mode:
authorjiangzhengwenjz <jiangzhengwenjzw@qq.com>2019-06-03 03:19:15 +0800
committerjiangzhengwenjz <jiangzhengwenjzw@qq.com>2019-06-03 03:22:03 +0800
commit49a1de36d38b41b0f3f7c443acc636281314b749 (patch)
tree5cee3105df23fe688e1a1ba4d05de7b9c1d0282f /src/vs_seeker.c
parent0a13397b8586bb4147d9e35c80a3c5aebff41d5b (diff)
sub_815B0CC and rollback of failed attempt to make it compilable
Diffstat (limited to 'src/vs_seeker.c')
-rw-r--r--src/vs_seeker.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/vs_seeker.c b/src/vs_seeker.c
index bd19d96ff..bd5b9c7ea 100644
--- a/src/vs_seeker.c
+++ b/src/vs_seeker.c
@@ -24,8 +24,6 @@
#include "unk_810c3a4.h"
#include "constants/movement_commands.h"
#include "vs_seeker.h"
-#include "item.h"
-#include "constants/items.h"
typedef enum
{
@@ -637,7 +635,6 @@ void sub_810C444(void)
#ifdef NONMATCHING
bool8 sub_810C4EC(void)
{
- s8 mask;
if (CheckBagHasItem(ITEM_VS_SEEKER, 1) == TRUE)
{
if ((gSaveBlock1Ptr->trainerRematchStepCounter & 0xFF) < 100)
@@ -646,23 +643,25 @@ bool8 sub_810C4EC(void)
if (FlagGet(0x801) == TRUE)
{
- register u8 x,y;
- x = gSaveBlock1Ptr->trainerRematchStepCounter >> 8;
- if (x > 99) {
- mask = -1;
- goto section_1;
+ u16 x;
+ do {
+ x = (gSaveBlock1Ptr->trainerRematchStepCounter >> 8) & 0xFF;
+ } while (0);
+ if (x < 100)
+ {
+ x++;
+ gSaveBlock1Ptr->trainerRematchStepCounter = ((u16)(x << 8)) | (gSaveBlock1Ptr->trainerRematchStepCounter & 0xFF);
+ }
+ do {
+ x = (gSaveBlock1Ptr->trainerRematchStepCounter >> 8) & 0xFF;
+ } while (0);
+ if (x == 100)
+ {
+ FlagClear(0x801);
+ sub_810C640();
+ sub_810D0D0();
+ return TRUE;
}
- y = ((u8)x + 1);
- gSaveBlock1Ptr->trainerRematchStepCounter = (((gSaveBlock1Ptr->trainerRematchStepCounter) & (u8)0xFFFFFFFF) | (y << 8));
- section_1:
- x = (gSaveBlock1Ptr->trainerRematchStepCounter >> 8) & mask;
- if (x == 100)
- {
- FlagClear(0x801);
- sub_810C640();
- sub_810D0D0();
- return TRUE;
- }
}
return FALSE;