From baa2e2a8fda5657983e8b64d85ca04c18300e897 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 24 Dec 2013 17:24:05 -0600 Subject: [PATCH] Try a vanilla CoffeeScript (haha) solution --- dist/habitrpg-shared.js | 10 ++++++---- script/index.coffee | 4 +--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 5c81cf6706..f81e5d0779 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11192,11 +11192,13 @@ var process=require("__browserify_process");(function() { _.each(user.tasks, function(task) { return task.value = 0; }); - _.each(user.tasks, function(task) { - if (task.type = 'daily') { - return task.streak = 0; + _ref = user.tasks; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + task = _ref[_i]; + if (task.type === 'daily') { + task.streak = 0; } - }); + } stats = user.stats; stats.buffs = {}; stats.hp = 50; diff --git a/script/index.coffee b/script/index.coffee index 2dd7b17632..0baed65149 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -408,9 +408,7 @@ api.wrap = (user) -> # Turn tasks yellow, zero out streaks _.each user.tasks, (task) -> task.value = 0 - _.each user.tasks, (task) -> - if task.type = 'daily' - task.streak = 0 + task.streak = 0 for task in user.tasks when task.type is 'daily' # Reset all dynamic stats stats = user.stats stats.buffs = {}