From 20f8a5dd5971fedf01ea49f4f26a8fb74a79acf9 Mon Sep 17 00:00:00 2001 From: scnorton Date: Tue, 11 Jul 2017 12:17:05 -0400 Subject: Futile attempt to get sub_80BC300 --- src/secret_base.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/secret_base.c b/src/secret_base.c index c35797168..17377a287 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -1,6 +1,9 @@ #include "global.h" #include "secret_base.h" #include "decoration.h" +#include "species.h" +#include "items.h" +#include "moves.h" #include "event_data.h" #include "field_camera.h" #include "field_fadetransition.h" @@ -821,32 +824,31 @@ u8 sub_80BC298(struct Pokemon *mon) { // 80bc298 } #ifdef NONMATCHING +// So much is wrong with this function. +// The compiler likes to store pointers in temp variables. That's not what it's supposed to do. void sub_80BC300(void) { + u16 partyidx; u16 moveidx; u16 sbpartyidx = 0; - int resetVal = 0; - u16 partyidx = 0; - while (partyidx < 6) { - partyidx ++; - for (moveidx=0; moveidx<4; moveidx++) { - gSaveBlock1.secretBases[0].partyMoves[(partyidx - 1) * 6 + moveidx] = resetVal; - } - gSaveBlock1.secretBases[0].partySpecies[partyidx - 1] = resetVal; - gSaveBlock1.secretBases[0].partyHeldItems[partyidx - 1] = resetVal; - gSaveBlock1.secretBases[0].partyLevels[partyidx - 1] = resetVal; - gSaveBlock1.secretBases[0].partyPersonality[partyidx - 1] = resetVal; - gSaveBlock1.secretBases[0].partyEVs[partyidx - 1] = resetVal; - if (GetMonData(&(gPlayerParty[partyidx - 1]), MON_DATA_SPECIES) != 0 && !GetMonData(&(gPlayerParty[partyidx - 1]), MON_DATA_IS_EGG)) { + for (partyidx=0; partyidx