mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Level command now also sets experience to avoid losing level upon form changes
This commit is contained in:
parent
168ed1cc55
commit
52011804b9
@ -933,9 +933,11 @@ void Ability_(u32 sourceLine, u32 ability)
|
||||
void Level_(u32 sourceLine, u32 level)
|
||||
{
|
||||
// TODO: Preserve any explicitly-set stats.
|
||||
u32 species = GetMonData(DATA.currentMon, MON_DATA_SPECIES);
|
||||
INVALID_IF(!DATA.currentMon, "Level outside of PLAYER/OPPONENT");
|
||||
INVALID_IF(level == 0 || level > MAX_LEVEL, "Illegal level: %d", level);
|
||||
SetMonData(DATA.currentMon, MON_DATA_LEVEL, &level);
|
||||
SetMonData(DATA.currentMon, MON_DATA_EXP, &gExperienceTables[gSpeciesInfo[species].growthRate][level]);
|
||||
}
|
||||
|
||||
void MaxHP_(u32 sourceLine, u32 maxHP)
|
||||
|
Loading…
Reference in New Issue
Block a user