Fix summary screen nature colours after mints (#3898)

This commit is contained in:
Bassoonian 2024-01-03 17:48:09 +01:00 committed by GitHub
parent cb89df82b5
commit e7fac028b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,6 +171,7 @@ static EWRAM_DATA struct PokemonSummaryScreenData
u8 OTName[17]; // 0x36
u32 OTID; // 0x48
u8 teraType;
u8 mintNature;
} summary;
u16 bgTilemapBuffers[PSS_PAGE_COUNT][2][0x400];
u8 mode;
@ -1510,6 +1511,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *mon)
if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->handleDeoxys == TRUE)
{
sum->nature = GetNature(mon);
sum->mintNature = GetMonData(mon, MON_DATA_HIDDEN_NATURE);
sum->currentHP = GetMonData(mon, MON_DATA_HP);
sum->maxHP = GetMonData(mon, MON_DATA_MAX_HP);
sum->atk = GetMonData(mon, MON_DATA_ATK);
@ -1521,6 +1523,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *mon)
else
{
sum->nature = GetNature(mon);
sum->mintNature = GetMonData(mon, MON_DATA_HIDDEN_NATURE);
sum->currentHP = GetMonData(mon, MON_DATA_HP);
sum->maxHP = GetMonData(mon, MON_DATA_MAX_HP);
sum->atk = GetMonData(mon, MON_DATA_ATK2);
@ -3500,7 +3503,7 @@ static void BufferLeftColumnStats(void)
u8 *maxHPString = Alloc(20);
u8 *attackString = Alloc(20);
u8 *defenseString = Alloc(20);
const s8 *natureMod = gNatureStatTable[sMonSummaryScreen->summary.nature];
const s8 *natureMod = gNatureStatTable[sMonSummaryScreen->summary.mintNature];
DynamicPlaceholderTextUtil_Reset();
BufferStat(currentHPString, 0, sMonSummaryScreen->summary.currentHP, 0, 3);
@ -3522,7 +3525,7 @@ static void PrintLeftColumnStats(void)
static void BufferRightColumnStats(void)
{
const s8 *natureMod = gNatureStatTable[sMonSummaryScreen->summary.nature];
const s8 *natureMod = gNatureStatTable[sMonSummaryScreen->summary.mintNature];
DynamicPlaceholderTextUtil_Reset();
BufferStat(gStringVar1, natureMod[STAT_SPATK - 1], sMonSummaryScreen->summary.spatk, 0, 3);