fix money/hp buying difference

This commit is contained in:
Tyler Renelle
2012-09-01 16:32:00 -04:00
parent e78cb66f9c
commit f0aa6299ea
2 changed files with 5 additions and 7 deletions

View File

@@ -69,7 +69,7 @@ updateStats = function(user, stats) {
};
module.exports.score = score = function(spec) {
var adjustvalue, cron, delta, diff, direction, exp, hp, lvl, modified, money, num, sign, task, type, user, value, _ref, _ref1, _ref2;
var adjustvalue, cron, delta, direction, exp, hp, lvl, modified, money, num, sign, task, type, user, value, _ref, _ref1, _ref2;
if (spec == null) {
spec = {
user: null,
@@ -124,9 +124,8 @@ module.exports.score = score = function(spec) {
num = task.get('value').toFixed(2);
statsNotification("<i class='icon-star'></i>GP -" + num, 'success');
if (money < 0) {
diff = hp + money;
hp = diff;
statsNotification("<i class='icon-heart'></i>HP -" + (diff.toFixed(2)), 'error');
hp += money;
statsNotification("<i class='icon-heart'></i>HP " + (money.toFixed(2)), 'error');
money = 0;
}
}