summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-10-27 20:50:32 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2017-10-27 20:50:32 -0400
commitd60ae05cbb801fe9e94de7f520e9726aec614679 (patch)
tree73865214a864e4879f27cead7c859af78ce4c794 /src
parentb30232a2e8dca235240715d0dcfa61e261cadda5 (diff)
sub_80EABDC
Diffstat (limited to 'src')
-rw-r--r--src/secret_base.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/secret_base.c b/src/secret_base.c
index f3b59facf..0434190d6 100644
--- a/src/secret_base.c
+++ b/src/secret_base.c
@@ -1612,3 +1612,29 @@ void sub_80EABA4(u32 *args, u8 b)
}
}
}
+
+bool8 sub_80EABDC(struct SecretBaseRecord *secretBase)
+{
+ u8 i;
+
+ if (secretBase->secretBaseId == 0)
+ return FALSE;
+
+ if (secretBase->secretBaseId && secretBase->gender != gSaveBlock2Ptr->playerGender)
+ return FALSE;
+
+ // Check if the player's trainer Id matches the secret base's id.
+ for (i = 0; i < 4; i ++)
+ {
+ if (secretBase->trainerId[i] != gSaveBlock2Ptr->playerTrainerId[i])
+ return FALSE;
+ }
+
+ for (i = 0; i < OT_NAME_LENGTH && (secretBase->trainerName[i] != EOS || gSaveBlock2Ptr->playerName[i] != EOS); i ++)
+ {
+ if (secretBase->trainerName[i] != gSaveBlock2Ptr->playerName[i])
+ return FALSE;
+ }
+
+ return TRUE;
+}