diff options
author | YamaArashi <shadow962@live.com> | 2016-12-29 13:31:25 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-12-29 13:31:25 -0800 |
commit | 4f4b6a3f5b6a205eed811fe8f0371ac2a2b27fc9 (patch) | |
tree | 6c50d3929dcb9fd1dca2ca96ebdf99396b8c317b /src | |
parent | b42f5c0f7fc9ac0161a6b6e2d764911ef375d040 (diff) |
add conditional bugfix for setting mon IVs
Diffstat (limited to 'src')
-rw-r--r-- | src/pokemon_2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pokemon_2.c b/src/pokemon_2.c index aeffb29a0..e747629d1 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -1016,7 +1016,11 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const u8 *data) break; case MON_DATA_IVS: { +#ifdef BUGFIX_SETMONIVS + u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[1] << 24); +#else u32 ivs = *data; // Bug: Only the HP IV and the lower 3 bits of the Attack IV are read. The rest become 0. +#endif substruct3->hpIV = ivs & 0x1F; substruct3->attackIV = (ivs >> 5) & 0x1F; substruct3->defenseIV = (ivs >> 10) & 0x1F; |