diff --git a/common/script/fns/autoAllocate.js b/common/script/fns/autoAllocate.js index 7e29c3384e..907f4c45d0 100644 --- a/common/script/fns/autoAllocate.js +++ b/common/script/fns/autoAllocate.js @@ -18,10 +18,10 @@ function getStatToAllocate (user) { return _.invert(stats)[_.min(stats)]; } case 'classbased': { + let preference; let lvlDiv7 = statsObj.lvl / 7; let ideal = [lvlDiv7 * 3, lvlDiv7 * 2, lvlDiv7, lvlDiv7]; - let preference; switch (statsObj.class) { case 'wizard': { preference = ['int', 'per', 'con', 'str']; @@ -70,5 +70,7 @@ function getStatToAllocate (user) { } module.exports = function autoAllocate (user) { - return user.stats[getStatToAllocate(user)]++; + let statToIncrease = getStatToAllocate(user); + + return user.stats[statToIncrease]++; };