Error in getMaxStat regarding negative xp, level will erroneously reset to 1.
public int getMaxStat(int skill) {
if (getMob() instanceof Player) {
int level = getLevelForExperience(getExperience(skill), getWorld().getServer().getConfig().PLAYER_LEVEL_LIMIT);
if (skill == HITS) {
return Math.max(level, 10);
}
return level;
} else {
return maxStatsMob[skill];
}
}
Even though we do explicitly save the player's "curstat", we do not save their max stat. Instead, it is recalculated constantly based on the player's experience.
This is wasteful, but it is also wrong. See https://www.youtube.com/watch?v=SGouMo5MH2s for the authentic behaviour.
This issue must be fixed before someone gets a billion XP.
Related issue #357 (closed)