mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
fix money/hp buying difference
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user