summaryrefslogtreecommitdiff
path: root/src/quest_log.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-10-16 13:07:02 -0700
committerPikalaxALT <pikalaxalt@gmail.com>2018-10-16 13:07:02 -0700
commit9dd047d9db67586529cbde6a32176413af659c1d (patch)
treedd3b97d998773041a7f8f405e8705b6e078331ef /src/quest_log.c
parent11066dc88f55c32ec1877c2f7e995412c4a07318 (diff)
sub_81131FC
Diffstat (limited to 'src/quest_log.c')
-rw-r--r--src/quest_log.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/quest_log.c b/src/quest_log.c
index 30f529615..51ffaac11 100644
--- a/src/quest_log.c
+++ b/src/quest_log.c
@@ -2331,3 +2331,32 @@ u8 sub_8113194(struct Var4038Struct * a0)
a0->unk_1 |= 1 << gUnknown_8456938[retval];
return gUnknown_8456938[retval];
}
+
+const u8 gUnknown_8456940[] = {
+ 5, 6, 3, 7, 4, 1, 0, 2
+};
+
+u8 sub_81131FC(struct Var4038Struct * a0)
+{
+ u8 i;
+ u8 retval = 0;
+
+ if (sub_81132A0(a0) == 1)
+ return 0;
+
+ for (i = 0; i < 8; i++)
+ {
+ if ((a0->unk_1 >> gUnknown_8456940[i]) & 1)
+ {
+ retval = i;
+ if (Random() % 2)
+ {
+ a0->unk_1 ^= 1 << gUnknown_8456940[i];
+ return gUnknown_8456940[i];
+ }
+ }
+ }
+ if ((a0->unk_1 >> gUnknown_8456940[retval]) & 1)
+ a0->unk_1 ^= 1 << gUnknown_8456940[retval];
+ return gUnknown_8456940[retval];
+}