Fixed call to sExpCandyExperienceTable

This commit is contained in:
Eduardo Quezada D'Ottone 2022-08-25 22:49:23 -04:00 committed by GitHub
parent 6b414d9555
commit 57d583b783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4894,7 +4894,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
else if (param < ARRAY_COUNT(sExpCandyExperienceTable)) // EXP Candies else if (param < ARRAY_COUNT(sExpCandyExperienceTable)) // EXP Candies
{ {
u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
dataUnsigned = sExpCandyExperienceTable[param] + GetMonData(mon, MON_DATA_EXP, NULL); dataUnsigned = sExpCandyExperienceTable[param - 1] + GetMonData(mon, MON_DATA_EXP, NULL);
if (dataUnsigned > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]) if (dataUnsigned > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL])
dataUnsigned = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]; dataUnsigned = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL];
} }