Fix bug where transformed pokemon lose copied stats on levelup (#7969)

This commit is contained in:
FosterProgramming 2025-10-17 20:27:54 +02:00 committed by GitHub
parent 358f3211ca
commit dd2eab0c41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4773,7 +4773,15 @@ static void Cmd_getexp(void)
if (battler != 0xFF)
{
CopyMonLevelAndBaseStatsToBattleMon(battler, &gPlayerParty[*expMonId]);
if (gBattleMons[battler].volatiles.transformed)
{
gBattleMons[battler].level = GetMonData(&gPlayerParty[*expMonId], MON_DATA_LEVEL);
gBattleMons[battler].hp = GetMonData(&gPlayerParty[*expMonId], MON_DATA_HP);
}
else
{
CopyMonLevelAndBaseStatsToBattleMon(battler, &gPlayerParty[*expMonId]);
}
if (gBattleMons[battler].volatiles.powerTrick)
SWAP(gBattleMons[battler].attack, gBattleMons[battler].defense, temp);
}