Expand Pokeball Substructure (#473)

* expand ball struct element

* remove test case
This commit is contained in:
ghoulslash 2020-07-16 01:10:21 -06:00 committed by GitHub
parent 6537310387
commit ad95f150a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 26 deletions

View File

@ -6,34 +6,37 @@
struct PokemonSubstruct0 struct PokemonSubstruct0
{ {
u16 species; /*0x00*/ u16 species;
u16 heldItem; /*0x02*/ u16 heldItem;
u32 experience; /*0x04*/ u32 experience;
u8 ppBonuses; /*0x08*/ u8 ppBonuses;
u8 friendship; /*0x09*/ u8 friendship;
}; /*0x0A*/ u8 pokeball:5; //31 balls
u8 unused0_A:3;
/*0x0B*/ u8 unused0_B;
}; /* size = 12 */
struct PokemonSubstruct1 struct PokemonSubstruct1
{ {
u16 moves[MAX_MON_MOVES]; /*0x00*/ u16 moves[MAX_MON_MOVES];
u8 pp[MAX_MON_MOVES]; /*0x08*/ u8 pp[MAX_MON_MOVES];
}; }; /* size = 12 */
struct PokemonSubstruct2 struct PokemonSubstruct2
{ {
u8 hpEV; /*0x00*/ u8 hpEV;
u8 attackEV; /*0x01*/ u8 attackEV;
u8 defenseEV; /*0x02*/ u8 defenseEV;
u8 speedEV; /*0x03*/ u8 speedEV;
u8 spAttackEV; /*0x04*/ u8 spAttackEV;
u8 spDefenseEV; /*0x05*/ u8 spDefenseEV;
u8 cool; /*0x06*/ u8 cool;
u8 beauty; /*0x07*/ u8 beauty;
u8 cute; /*0x08*/ u8 cute;
u8 smart; /*0x09*/ u8 smart;
u8 tough; /*0x0A*/ u8 tough;
u8 sheen; /*0x0B*/ u8 sheen;
}; }; /* size = 12 */
struct PokemonSubstruct3 struct PokemonSubstruct3
{ {
@ -42,7 +45,7 @@ struct PokemonSubstruct3
/* 0x02 */ u16 metLevel:7; /* 0x02 */ u16 metLevel:7;
/* 0x02 */ u16 metGame:4; /* 0x02 */ u16 metGame:4;
/* 0x03 */ u16 pokeball:4; /* 0x03 */ u16 unused3_3:4;
/* 0x03 */ u16 otGender:1; /* 0x03 */ u16 otGender:1;
/* 0x04 */ u32 hpIV:5; /* 0x04 */ u32 hpIV:5;
@ -73,7 +76,7 @@ struct PokemonSubstruct3
/* 0x0B */ u32 giftRibbon7:1; /* 0x0B */ u32 giftRibbon7:1;
/* 0x0B */ u32 fatefulEncounter:4; /* 0x0B */ u32 fatefulEncounter:4;
/* 0x0B */ u32 obedient:1; /* 0x0B */ u32 obedient:1;
}; }; /* size = 12 */
union PokemonSubstruct union PokemonSubstruct
{ {

View File

@ -3853,7 +3853,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
retVal = substruct3->metGame; retVal = substruct3->metGame;
break; break;
case MON_DATA_POKEBALL: case MON_DATA_POKEBALL:
retVal = substruct3->pokeball; retVal = substruct0->pokeball;
break; break;
case MON_DATA_OT_GENDER: case MON_DATA_OT_GENDER:
retVal = substruct3->otGender; retVal = substruct3->otGender;
@ -4227,7 +4227,7 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
case MON_DATA_POKEBALL: case MON_DATA_POKEBALL:
{ {
u8 pokeball = *data; u8 pokeball = *data;
substruct3->pokeball = pokeball; substruct0->pokeball = pokeball;
break; break;
} }
case MON_DATA_OT_GENDER: case MON_DATA_OT_GENDER: