Document battle pike

This commit is contained in:
Marcus Huderle 2019-02-07 17:37:41 -06:00
parent 4785a07acd
commit 85040e26fd
4 changed files with 398 additions and 377 deletions

View file

@ -356,10 +356,10 @@ struct BattleFrontier
/*0xE04*/ u16 pikeWinStreaks[2]; /*0xE04*/ u16 pikeWinStreaks[2];
/*0xE08*/ u16 pikeRecordStreaks[2]; /*0xE08*/ u16 pikeRecordStreaks[2];
/*0xE0C*/ u16 pikeTotalStreaks[2]; /*0xE0C*/ u16 pikeTotalStreaks[2];
/*0xE10*/ u8 field_E10_1:3; /*0xE10*/ u8 pikeHintedRoomIndex:3;
/*0xE10*/ u8 field_E10_2:4; /*0xE10*/ u8 pikeHintedRoomType:4;
/*0xE10*/ u8 field_E10_3:1; /*0xE10*/ u8 pikeHealingRoomsDisabled:1;
/*0xE12*/ u16 field_E12[3]; /*0xE12*/ u16 pikeHeldItemsBackup[3];
/*0xE18*/ u16 pyramidRewardItem; /*0xE18*/ u16 pyramidRewardItem;
/*0xE1A*/ u16 pyramidWinStreaks[2]; /*0xE1A*/ u16 pyramidWinStreaks[2];
/*0xE1E*/ u16 pyramidRecordStreaks[2]; /*0xE1E*/ u16 pyramidRecordStreaks[2];

View file

@ -333,7 +333,6 @@ static void GenerateOpponentMons(void)
for (k = firstMonId; k < firstMonId + i; k++) for (k = firstMonId; k < firstMonId + i; k++)
{ {
// BUG: Small undefined behavior bug, since species array values were not initialized.
if (species[k] == gFacilityTrainerMons[monSetId].species) if (species[k] == gFacilityTrainerMons[monSetId].species)
break; break;
} }
@ -342,7 +341,6 @@ static void GenerateOpponentMons(void)
for (k = firstMonId; k < firstMonId + i; k++) for (k = firstMonId; k < firstMonId + i; k++)
{ {
// BUG: Small undefined behavior bug, since heldItems array values were not initialized.
if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]) if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId])
break; break;
} }

File diff suppressed because it is too large Load diff

View file

@ -97,7 +97,7 @@ struct PyramidTrainerEncounterMusic
}; };
// This file's functions. // This file's functions.
static void InitPyramidBag(void); static void InitPyramidChallenge(void);
static void GetBattlePyramidData(void); static void GetBattlePyramidData(void);
static void SetBattlePyramidData(void); static void SetBattlePyramidData(void);
static void sub_81A9134(void); static void sub_81A9134(void);
@ -814,7 +814,7 @@ static const u8 sHintTextTypes[] =
static void (* const sBattlePyramidFunctions[])(void) = static void (* const sBattlePyramidFunctions[])(void) =
{ {
InitPyramidBag, InitPyramidChallenge,
GetBattlePyramidData, GetBattlePyramidData,
SetBattlePyramidData, SetBattlePyramidData,
sub_81A9134, sub_81A9134,
@ -865,7 +865,7 @@ void CallBattlePyramidFunction(void)
sBattlePyramidFunctions[gSpecialVar_0x8004](); sBattlePyramidFunctions[gSpecialVar_0x8004]();
} }
static void InitPyramidBag(void) static void InitPyramidChallenge(void)
{ {
bool32 isCurrent; bool32 isCurrent;
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;