Fixes Roamers not saving shininess (#7185)

This commit is contained in:
i0brendan0 2025-06-23 08:05:01 -05:00 committed by GitHub
parent 753eb9f8d8
commit 0ccf797cce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -680,7 +680,8 @@ struct Roamer
/*0x12*/ u8 tough;
/*0x13*/ bool8 active;
/*0x14*/ u8 statusB; // Stores frostbite
/*0x14*/ u8 filler[0x7];
/*0x15*/ bool8 shiny;
/*0x16*/ u8 filler[0x6];
};
struct RamScriptData

View File

@ -113,6 +113,7 @@ static void CreateInitialRoamerMon(u8 index, u16 species, u8 level)
ROAMER(index)->cute = GetMonData(&gEnemyParty[0], MON_DATA_CUTE);
ROAMER(index)->smart = GetMonData(&gEnemyParty[0], MON_DATA_SMART);
ROAMER(index)->tough = GetMonData(&gEnemyParty[0], MON_DATA_TOUGH);
ROAMER(index)->shiny = GetMonData(&gEnemyParty[0], MON_DATA_IS_SHINY);
ROAMER(index)->active = TRUE;
sRoamerLocation[index][MAP_GRP] = ROAMER_MAP_GROUP;
sRoamerLocation[index][MAP_NUM] = sRoamerLocations[Random() % NUM_LOCATION_SETS][0];
@ -243,8 +244,6 @@ void CreateRoamerMonInstance(u32 roamerIndex)
struct Pokemon *mon = &gEnemyParty[0];
ZeroEnemyPartyMons();
CreateMonWithIVsPersonality(mon, ROAMER(roamerIndex)->species, ROAMER(roamerIndex)->level, ROAMER(roamerIndex)->ivs, ROAMER(roamerIndex)->personality);
// The roamer's status field is u16, but SetMonData expects status to be u32, so will set the roamer's status
// using the status field and the following 3 bytes (cool, beauty, and cute).
SetMonData(mon, MON_DATA_STATUS, &status);
SetMonData(mon, MON_DATA_HP, &ROAMER(roamerIndex)->hp);
SetMonData(mon, MON_DATA_COOL, &ROAMER(roamerIndex)->cool);
@ -252,6 +251,7 @@ void CreateRoamerMonInstance(u32 roamerIndex)
SetMonData(mon, MON_DATA_CUTE, &ROAMER(roamerIndex)->cute);
SetMonData(mon, MON_DATA_SMART, &ROAMER(roamerIndex)->smart);
SetMonData(mon, MON_DATA_TOUGH, &ROAMER(roamerIndex)->tough);
SetMonData(mon, MON_DATA_IS_SHINY, &ROAMER(roamerIndex)->shiny);
}
bool8 TryStartRoamerEncounter(void)