SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

player_setlevel does not update XP properly

spacechase0 opened this issue ยท 1 comments

commented

When a level is gained, XP is not reset to 0. It stays at the previous value.

For example, when you get to level 1, you ordinarily have 100 XP. For level 2, you need 380 XP. This means you need to get 280 XP. However, if you use player_setlevel <skill> 1, you would actually need to get the full 380 XP to level up to level 2.

Similarly, if you were level 3 and did player_setlevel <skill> 1, you would be unable to earn levels 2 or 3 due to the XP not being reset - you would have to wait until level 4 for things to go back to normal. (It seems like it should immediately bump up to level 3 again, but it doesn't due to the way Farmer.gainExperience and Farmer.checkForLevelGain interact.)

commented

Fixed in develop for the upcoming SMAPI 2.1 release.