From 7eb96ec615653c9939e63f843b76bdfe9538ad88 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Tue, 14 Jan 2025 14:42:55 -0500 Subject: [PATCH] Use SET8 and SET32 consistently (#5544) Co-authored-by: Rose <83477269+AreaZR@users.noreply.github.com> --- src/pokemon.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index eaffcabd39..efb4d91abb 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3074,20 +3074,14 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) SET8(substruct3->metLocation); break; case MON_DATA_MET_LEVEL: - { - u8 metLevel = *data; - substruct3->metLevel = metLevel; + SET8(substruct3->metLevel); break; - } case MON_DATA_MET_GAME: SET8(substruct3->metGame); break; case MON_DATA_POKEBALL: - { - u8 pokeball = *data; - substruct0->pokeball = pokeball; + SET8(substruct0->pokeball); break; - } case MON_DATA_OT_GENDER: SET8(substruct3->otGender); break; @@ -3175,7 +3169,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) break; case MON_DATA_IVS: { - u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); + u32 ivs; + SET32(ivs); substruct3->hpIV = ivs & MAX_IV_MASK; substruct3->attackIV = (ivs >> 5) & MAX_IV_MASK; substruct3->defenseIV = (ivs >> 10) & MAX_IV_MASK; @@ -3212,12 +3207,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) SET8(substruct3->gigantamaxFactor); break; case MON_DATA_TERA_TYPE: - { - u32 teraType; - SET8(teraType); - substruct0->teraType = teraType; + SET8(substruct0->teraType); break; - } case MON_DATA_EVOLUTION_TRACKER: { union EvolutionTracker evoTracker;