fix(common): Corrects bug where stat points could be awarded after level 100

Closes #6434
This commit is contained in:
Blade Barringer
2016-01-04 07:58:24 -06:00
parent 837c27ff4c
commit 2bbdf66d76
2 changed files with 39 additions and 5 deletions

View File

@@ -2287,15 +2287,15 @@ api.wrap = function(user, main) {
user.stats.lvl++;
experienceToNextLevel = api.tnl(user.stats.lvl);
user.stats.hp = 50;
var userTotalStatPoints = user.stats.str + user.stats.int + user.stats.con + user.stats.per;
var allocatedStatPoints = user.stats.str + user.stats.int + user.stats.con + user.stats.per
if (userTotalStatPoints >= MAX_STAT_POINTS) {
if (allocatedStatPoints >= MAX_STAT_POINTS) {
continue;
}
if (user.preferences.automaticAllocation) {
user.fns.autoAllocate();
} else {
user.stats.points = user.stats.lvl - userTotalStatPoints;
user.stats.points = MAX_STAT_POINTS - allocatedStatPoints;
if (user.stats.points < 0) {
user.stats.points = 0;
}