Skip to content

Commit

Permalink
Flip bit to make not shiny instead of rerolling
Browse files Browse the repository at this point in the history
This is better than advancing the RNG because it avoids looping and it makes more IVs accessible.
  • Loading branch information
AreaZR committed Dec 10, 2023
1 parent 237c156 commit 3a3c592
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
#if P_FLAG_FORCE_NO_SHINY != 0
if (FlagGet(P_FLAG_FORCE_NO_SHINY))
{
while (GET_SHINY_VALUE(value, personality) < SHINY_ODDS)
personality = Random32();
if (GET_SHINY_VALUE(value, personality) < SHINY_ODDS)
personality ^= 0x10000000; // Flip bit so it won't be shiny
}
#endif
#if P_FLAG_FORCE_SHINY != 0
Expand Down

0 comments on commit 3a3c592

Please sign in to comment.