Use SET8 and SET32 consistently

Use the macros we have instead of doing it manually.
This commit is contained in:
Rose 2024-10-19 13:35:37 -04:00
parent 85197eda5e
commit 0db9c8c4ce

View file

@ -3061,20 +3061,14 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
SET8(substruct3->metLocation); SET8(substruct3->metLocation);
break; break;
case MON_DATA_MET_LEVEL: case MON_DATA_MET_LEVEL:
{ SET8(substruct3->metLevel);
u8 metLevel = *data;
substruct3->metLevel = metLevel;
break; break;
}
case MON_DATA_MET_GAME: case MON_DATA_MET_GAME:
SET8(substruct3->metGame); SET8(substruct3->metGame);
break; break;
case MON_DATA_POKEBALL: case MON_DATA_POKEBALL:
{ SET8(substruct0->pokeball);
u8 pokeball = *data;
substruct0->pokeball = pokeball;
break; break;
}
case MON_DATA_OT_GENDER: case MON_DATA_OT_GENDER:
SET8(substruct3->otGender); SET8(substruct3->otGender);
break; break;
@ -3162,7 +3156,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
break; break;
case MON_DATA_IVS: 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->hpIV = ivs & MAX_IV_MASK;
substruct3->attackIV = (ivs >> 5) & MAX_IV_MASK; substruct3->attackIV = (ivs >> 5) & MAX_IV_MASK;
substruct3->defenseIV = (ivs >> 10) & MAX_IV_MASK; substruct3->defenseIV = (ivs >> 10) & MAX_IV_MASK;
@ -3199,12 +3194,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
SET8(substruct3->gigantamaxFactor); SET8(substruct3->gigantamaxFactor);
break; break;
case MON_DATA_TERA_TYPE: case MON_DATA_TERA_TYPE:
{ SET8(substruct0->teraType);
u32 teraType;
SET8(teraType);
substruct0->teraType = teraType;
break; break;
}
case MON_DATA_EVOLUTION_TRACKER: case MON_DATA_EVOLUTION_TRACKER:
{ {
union EvolutionTracker evoTracker; union EvolutionTracker evoTracker;