Merge pull request #1329 from Kurausukun/fakematches

[LEAK-INFORMED] Resolve Fakematches
This commit is contained in:
GriffinR
2021-02-15 23:59:55 -05:00
committed by GitHub
2 changed files with 10 additions and 10 deletions
+7 -6
View File
@@ -5774,6 +5774,8 @@ static void InitRandomTourneyTreeResults(void)
int monTypesBits; int monTypesBits;
int trainerId; int trainerId;
int monId; int monId;
int zero1;
int zero2;
u8 lvlMode; u8 lvlMode;
u16 *statSums; u16 *statSums;
int *statValues; int *statValues;
@@ -5789,12 +5791,11 @@ static void InitRandomTourneyTreeResults(void)
statValues = AllocZeroed(sizeof(int) * NUM_STATS); statValues = AllocZeroed(sizeof(int) * NUM_STATS);
lvlMode = gSaveBlock2Ptr->frontier.lvlMode; lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
gSaveBlock2Ptr->frontier.lvlMode = FRONTIER_LVL_50; gSaveBlock2Ptr->frontier.lvlMode = FRONTIER_LVL_50;
// This one, I'd like to call a 'C fakematching'. zero1 = 0;
{ zero2 = 0;
u8 one;
gSaveBlock2Ptr->frontier.domeLvlMode = (one = 1); gSaveBlock2Ptr->frontier.domeLvlMode = zero1 + 1;
gSaveBlock2Ptr->frontier.domeBattleMode = one; gSaveBlock2Ptr->frontier.domeBattleMode = zero2 + 1;
}
for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++)
{ {
+3 -4
View File
@@ -165,12 +165,11 @@ const u16 gUnknown_085B0838[] = {RGB(0, 0, 0), RGB(0, 0, 0)};
void SetContestWinnerForPainting(int contestWinnerId) void SetContestWinnerForPainting(int contestWinnerId)
{ {
// probably fakematching
u8 *ptr1 = &gUnknown_02039F5D; u8 *ptr1 = &gUnknown_02039F5D;
u8 *ptr2 = &gUnknown_02039F5C; u8 *ptr2 = &gUnknown_02039F5C;
gCurContestWinner = gSaveBlock1Ptr->contestWinners[contestWinnerId - 1]; gCurContestWinner = gSaveBlock1Ptr->contestWinners[contestWinnerId - 1];
*ptr1 = contestWinnerId - 1; *ptr1 = contestWinnerId - 1;
*ptr2 = FALSE; *ptr2 = FALSE;
} }
void CB2_ContestPainting(void) void CB2_ContestPainting(void)