diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index f08a4d3bde..fe504be96f 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11656,6 +11656,14 @@ var process=require("__browserify_process");(function() { } return typeof cb === "function" ? cb(null, user) : void 0; }, + allocateNow: function(req, cb) { + _.times(user.stats.points, user.fns.autoAllocate); + user.stats.points = 0; + if (typeof user.markModified === "function") { + user.markModified('stats'); + } + return typeof cb === "function" ? cb(null, user.stats) : void 0; + }, clearCompleted: function(req, cb) { _.remove(user.todos, function(t) { var _ref; diff --git a/script/index.coffee b/script/index.coffee index 19dfe29bbf..53c056fc53 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -467,6 +467,12 @@ api.wrap = (user, main=true) -> user.achievements.rebirthLevel = lvl cb? null, user + allocateNow: (req, cb) -> + _.times user.stats.points, user.fns.autoAllocate + user.stats.points = 0 + user.markModified? 'stats' + cb? null, user.stats + # ------ # Tasks # ------