BUGFIX: Wally's ralts can be shiny

This actually was not an oversight, but a bug. The reason this never appears in the decomp is because compiler just optimized it out because the original programmer forgot continue does not do what he thought it did in a do-while loop.
This commit is contained in:
AZero13 2026-03-17 14:27:36 -04:00
parent 25ffb2c12c
commit 3e646d3bd7
3 changed files with 8 additions and 3 deletions

View File

@ -399,7 +399,7 @@ void CreateMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFix
void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
void CreateMonWithNature(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 nature);
void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 gender, u8 nature, u8 unownLetter);
void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level);
void CreateTutorialMon(struct Pokemon *mon, u16 species, u8 level);
void CreateMonWithIVsPersonality(struct Pokemon *mon, u16 species, u8 level, u32 ivs, u32 personality);
void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u32 otId);
void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 evSpread);

View File

@ -479,7 +479,7 @@ static void DoBattlePyramidTrainerHillBattle(void)
// Initiates battle where Wally catches Ralts
void StartWallyTutorialBattle(void)
{
CreateMaleMon(&gEnemyParty[0], SPECIES_RALTS, 5);
CreateTutorialMon(&gEnemyParty[0], SPECIES_RALTS, 5);
LockPlayerFieldControls();
gMain.savedCallback = CB2_ReturnToFieldContinueScriptPlayMapMusic;
gBattleTypeFlags = BATTLE_TYPE_WALLY_TUTORIAL;

View File

@ -2346,7 +2346,7 @@ void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level,
}
// This is only used to create Wally's Ralts.
void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level)
void CreateTutorialMon(struct Pokemon *mon, u16 species, u8 level)
{
u32 personality;
u32 otId;
@ -2356,7 +2356,12 @@ void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level)
otId = Random32();
personality = Random32();
}
#ifdef BUGFIX
while (GetGenderFromSpeciesAndPersonality(species, personality) != MON_MALE ||
GET_SHINY_VALUE(otId, personality) < SHINY_ODDS);
#else
while (GetGenderFromSpeciesAndPersonality(species, personality) != MON_MALE);
#endif
CreateMon(mon, species, level, USE_RANDOM_IVS, TRUE, personality, OT_ID_PRESET, otId);
}