summaryrefslogtreecommitdiff
path: root/src/pokemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pokemon.c')
-rw-r--r--src/pokemon.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/pokemon.c b/src/pokemon.c
index fc9a0843f..4479fa448 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -3642,7 +3642,8 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
struct PokemonSubstruct2 *substruct2 = NULL;
struct PokemonSubstruct3 *substruct3 = NULL;
- if (field > MON_DATA_10)
+ // Any field greater than MON_DATA_ENCRYPT_SEPARATOR is encrypted and must be treated as such
+ if (field > MON_DATA_ENCRYPT_SEPARATOR)
{
substruct0 = &(GetSubstruct(boxMon, boxMon->personality, 0)->type0);
substruct1 = &(GetSubstruct(boxMon, boxMon->personality, 1)->type1);
@@ -3736,7 +3737,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
case MON_DATA_CHECKSUM:
retVal = boxMon->checksum;
break;
- case MON_DATA_10:
+ case MON_DATA_ENCRYPT_SEPARATOR:
retVal = boxMon->unknown;
break;
case MON_DATA_SPECIES:
@@ -3977,7 +3978,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
break;
}
- if (field > MON_DATA_10)
+ if (field > MON_DATA_ENCRYPT_SEPARATOR)
EncryptBoxMon(boxMon);
return retVal;
@@ -4040,7 +4041,7 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
struct PokemonSubstruct2 *substruct2 = NULL;
struct PokemonSubstruct3 *substruct3 = NULL;
- if (field > MON_DATA_10)
+ if (field > MON_DATA_ENCRYPT_SEPARATOR)
{
substruct0 = &(GetSubstruct(boxMon, boxMon->personality, 0)->type0);
substruct1 = &(GetSubstruct(boxMon, boxMon->personality, 1)->type1);
@@ -4099,7 +4100,7 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
case MON_DATA_CHECKSUM:
SET16(boxMon->checksum);
break;
- case MON_DATA_10:
+ case MON_DATA_ENCRYPT_SEPARATOR:
SET16(boxMon->unknown);
break;
case MON_DATA_SPECIES:
@@ -4295,7 +4296,7 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
break;
}
- if (field > MON_DATA_10)
+ if (field > MON_DATA_ENCRYPT_SEPARATOR)
{
boxMon->checksum = CalculateBoxMonChecksum(boxMon);
EncryptBoxMon(boxMon);