mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Added check for total points before skipping attribution
This commit is contained in:
@@ -2281,13 +2281,14 @@ api.wrap = function(user, main) {
|
|||||||
user.stats.lvl++;
|
user.stats.lvl++;
|
||||||
tnl = api.tnl(user.stats.lvl);
|
tnl = api.tnl(user.stats.lvl);
|
||||||
user.stats.hp = 50;
|
user.stats.hp = 50;
|
||||||
if (user.stats.lvl > api.maxLevel) {
|
var totalStatPoints = user.stats.str + user.stats.int + user.stats.con + user.stats.per;
|
||||||
|
if (user.stats.lvl > api.maxLevel && totalPoints >= 100 ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (user.preferences.automaticAllocation) {
|
if (user.preferences.automaticAllocation) {
|
||||||
user.fns.autoAllocate();
|
user.fns.autoAllocate();
|
||||||
} else {
|
} else {
|
||||||
user.stats.points = user.stats.lvl - (user.stats.con + user.stats.str + user.stats.per + user.stats.int);
|
user.stats.points = user.stats.lvl - totalStatPoints;
|
||||||
if (user.stats.points < 0) {
|
if (user.stats.points < 0) {
|
||||||
user.stats.points = 0;
|
user.stats.points = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user