Tweak IV generation slightly (#4876)
With HQ_RANDOM on, this means that the generator now only consumes one RNG output when generating IVs. Without HQ_RANDOM on, IV generation should be unchanged.
This commit is contained in:
parent
3372503430
commit
05ff7cef1c
1 changed files with 3 additions and 2 deletions
|
@ -1206,7 +1206,8 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
|
|||
else
|
||||
{
|
||||
u32 iv;
|
||||
value = Random();
|
||||
u32 ivRandom = Random32();
|
||||
value = (u16)ivRandom;
|
||||
|
||||
iv = value & MAX_IV_MASK;
|
||||
SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv);
|
||||
|
@ -1215,7 +1216,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
|
|||
iv = (value & (MAX_IV_MASK << 10)) >> 10;
|
||||
SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv);
|
||||
|
||||
value = Random();
|
||||
value = (u16)(ivRandom >> 16);
|
||||
|
||||
iv = value & MAX_IV_MASK;
|
||||
SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv);
|
||||
|
|
Loading…
Reference in a new issue