Fix bug when changing forms multiple times (#8458)

This commit is contained in:
FosterProgramming 2025-12-08 12:18:56 +01:00 committed by GitHub
parent af18615a46
commit aafa937b86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -919,8 +919,6 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, u8 changeType)
bool32 isShiny;
const void *src;
const u16 *paletteData;
struct Pokemon *monAtk = GetBattlerMon(battlerAtk);
struct Pokemon *monDef = GetBattlerMon(battlerDef);
void *dst;
if (IsContest())
@ -938,7 +936,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, u8 changeType)
else
{
position = GetBattlerPosition(battlerAtk);
if (gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies == SPECIES_NONE)
if (changeType == SPECIES_GFX_CHANGE_TRANSFORM)
{
// Get base form if its currently Gigantamax
if (IsGigantamaxed(battlerDef))
@ -946,13 +944,13 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, u8 changeType)
else if (gBattleStruct->illusion[battlerDef].state == ILLUSION_ON)
targetSpecies = GetIllusionMonSpecies(battlerDef);
else
targetSpecies = GetMonData(monDef, MON_DATA_SPECIES);
gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies = targetSpecies;
targetSpecies = gBattleMons[battlerDef].species;
}
else
{
targetSpecies = gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies;
targetSpecies = gBattleMons[battlerAtk].species;
}
gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies = targetSpecies;
if (changeType == SPECIES_GFX_CHANGE_TRANSFORM)
{
@ -961,8 +959,8 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, u8 changeType)
}
else
{
personalityValue = GetMonData(monAtk, MON_DATA_PERSONALITY);
isShiny = GetMonData(monAtk, MON_DATA_IS_SHINY);
personalityValue = gBattleMons[battlerAtk].personality;
isShiny = gBattleMons[battlerAtk].isShiny;
}
HandleLoadSpecialPokePic(!IsOnPlayerSide(battlerAtk),
gMonSpritesGfxPtr->spritesGfx[position],