Document MON_DATA_10

This commit is contained in:
hjk321 2019-04-27 16:45:32 -06:00 committed by huderlem
parent 106a89eace
commit 438c5432aa
3 changed files with 9 additions and 8 deletions

View File

@ -14,7 +14,7 @@
#define MON_DATA_OT_NAME 7
#define MON_DATA_MARKINGS 8
#define MON_DATA_CHECKSUM 9
#define MON_DATA_10 10
#define MON_DATA_ENCRYPT_SEPARATOR 10
#define MON_DATA_SPECIES 11
#define MON_DATA_HELD_ITEM 12
#define MON_DATA_MOVE1 13

View File

@ -556,7 +556,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, (gSpeciesNames[gEvolutionTable[preEvoSpecies][1].targetSpecies]));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_10, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_ENCRYPT_SEPARATOR, (&data));
for (i = MON_DATA_COOL_RIBBON; i < MON_DATA_COOL_RIBBON + 5; i++)
SetMonData(&gPlayerParty[gPlayerPartyCount], i, (&data));

View File

@ -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);