From b93445ed935ec1d8ebf6ebf4b51ffe2ebbe05d63 Mon Sep 17 00:00:00 2001 From: Alice Harris Date: Wed, 17 Sep 2014 06:24:39 +1000 Subject: [PATCH] allows stats to change for users who used rebirth --- dist/habitrpg-shared.js | 23 +++++++++++++++-------- script/index.coffee | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index fef9014d0a..5e1f0ccf88 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -12438,7 +12438,7 @@ module.exports = { strings: null, translations: {}, t: function(stringName) { - var locale, string, stringNotFound, vars; + var e, locale, string, stringNotFound, vars; vars = arguments[1]; if (_.isString(arguments[1])) { vars = null; @@ -12452,12 +12452,22 @@ module.exports = { } string = !module.exports.strings ? module.exports.translations[locale][stringName] : module.exports.strings[stringName]; if (string) { - return _.template(string, vars || {}); + try { + return _.template(string, vars || {}); + } catch (_error) { + e = _error; + return 'Error processing string. Please report to http://github.com/HabitRPG/habitrpg.'; + } } else { stringNotFound = !module.exports.strings ? module.exports.translations[locale].stringNotFound : module.exports.strings.stringNotFound; - return _.template(stringNotFound, { - string: stringName - }); + try { + return _.template(stringNotFound, { + string: stringName + }); + } catch (_error) { + e = _error; + return 'Error processing string. Please report to http://github.com/HabitRPG/habitrpg.'; + } } } }; @@ -13263,9 +13273,6 @@ api.wrap = function(user, main) { user.achievements.rebirthLevel = lvl; } user.stats.buffs = {}; - if (typeof user.markModified === "function") { - user.markModified('stats'); - } if (typeof cb === "function") { cb(null, user); } diff --git a/script/index.coffee b/script/index.coffee index cbd64cd8dd..d007bfde55 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -495,7 +495,7 @@ api.wrap = (user, main=true) -> user.achievements.rebirths++ user.achievements.rebirthLevel = lvl user.stats.buffs = {} - user.markModified? 'stats' + # user.markModified? 'stats' cb? null, user ga?.event('purchase', 'Rebirth').send()