diff --git a/src/code_8012A18_1.c b/src/code_8012A18_1.c index a410a23a2..cc7070598 100644 --- a/src/code_8012A18_1.c +++ b/src/code_8012A18_1.c @@ -26,29 +26,19 @@ struct unkStruct_203B1FC extern struct unkStruct_203B1FC *gUnknown_203B1FC; -// https://decomp.me/scratch/6BUMI - Seth -s32 sub_8015F44(void) +s32 sub_8015F44(void) { - -#ifndef NONMATCHING - register s32 index asm("r2"); -#else s32 index; -#endif s32 counter; index = 0; - if(index < gUnknown_203B1FC->unk1B) - { - if(gUnknown_203B1FC->unkF8[0] == '\0') - return index; + if (index < gUnknown_203B1FC->unk1B && gUnknown_203B1FC->unkF8[0] != 0) { index = 1; counter = 1; - while (1) { - - if(counter >= gUnknown_203B1FC->unk1B) + while (TRUE) { + if (counter >= gUnknown_203B1FC->unk1B) return index; - if(gUnknown_203B1FC->unkF8[counter] == '\0') + if (gUnknown_203B1FC->unkF8[counter] == 0) return index; index = counter + 1; counter = index;