Skip to content

Commit

Permalink
Fix summary screen nature colours after mints (#3898)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bassoonian authored Jan 3, 2024
1 parent cb89df8 commit e7fac02
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pokemon_summary_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit e7fac02

Please sign in to comment.