summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhlosioneer <mattmdrr2@gmail.com>2019-02-12 03:48:32 -0500
committerPhlosioneer <mattmdrr2@gmail.com>2019-02-17 23:14:14 -0500
commit729e7116f2a71d72a7a3ab90d12159130a1d6a16 (patch)
treea01456dba2de6daa3c2d9f3e24f82d7770620c8f /src
parent5441d80ebc694e56b080d9f280b974ff50eed1fb (diff)
Decompiled AnyMonHasRibbon
Diffstat (limited to 'src')
-rw-r--r--src/pokenav_main.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/pokenav_main.c b/src/pokenav_main.c
index 3f6f8eb5c..125ced646 100644
--- a/src/pokenav_main.c
+++ b/src/pokenav_main.c
@@ -5,6 +5,7 @@
#include "overworld.h"
#include "field_weather.h"
#include "palette.h"
+#include "pokemon_storage_system.h"
struct UnknownStruct_0203CF40 {
u32 field_0;
@@ -24,7 +25,7 @@ extern void sub_81C7418(void);
extern void sub_81C7170(u8 a0);
extern void sub_81C71E4(u8 a0);
extern void sub_81C7650(s32 a0);
-extern u32 sub_81C7388(void);
+extern u32 AnyMonHasRibbon(void);
void sub_81C72BC(void);
void sub_81C7360(struct UnknownStruct_0203CF40 *a0);
@@ -202,6 +203,32 @@ void sub_81C7360(struct UnknownStruct_0203CF40 *a0) {
}
a0->field_2 = 0;
a0->field_1 = 0;
- a0->field_3 = sub_81C7388();
+ a0->field_3 = AnyMonHasRibbon();
a0->field_0 = 0;
+}
+
+bool32 AnyMonHasRibbon() {
+ s32 i;
+ s32 j;
+
+ for (i = 0; i < 6; i++) {
+ if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES)
+ && !GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_EGG)
+ && GetMonData(&gPlayerParty[i], MON_DATA_RIBBON_COUNT) != 0)
+ {
+ return TRUE;
+ }
+ }
+
+ for (j = 0; j < 14; j++) {
+ for (i = 0; i < 30; i++) {
+ if (CheckBoxMonSanityAt(j, i)
+ && GetBoxMonDataAt(j, i, MON_DATA_RIBBON_COUNT) != 0)
+ {
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
} \ No newline at end of file