Fix bug (preexisting in Fortify, new in Rebirth) that zeroed out prices of custom Rewards

This commit is contained in:
Sabe Jones 2013-12-24 21:55:54 -06:00
parent 79bd322900
commit 6f4427b087
2 changed files with 10 additions and 7 deletions

View file

@ -11175,7 +11175,9 @@ var process=require("__browserify_process");(function() {
}
user.balance--;
_.each(user.tasks, function(task) {
return task.value = 0;
if (task.type(!'reward')) {
return task.value = 0;
}
});
user.stats.hp = 50;
return cb(null, req);
@ -11190,10 +11192,9 @@ var process=require("__browserify_process");(function() {
}
user.balance -= 2;
_.each(user.tasks, function(task) {
return task.value = 0;
});
_.each(user.tasks, function(task) {
task.value = 0;
if (task.type(!'reward')) {
task.value = 0;
}
if (task.type === 'daily') {
return task.streak = 0;
}

View file

@ -397,7 +397,8 @@ api.wrap = (user) ->
return cb {code:401,message: "Not enough gems."}, req
user.balance--
_.each user.tasks, (task) ->
task.value = 0
if task.type not 'reward'
task.value = 0
user.stats.hp = 50
cb null, req
@ -407,7 +408,8 @@ api.wrap = (user) ->
user.balance -= 2
# Turn tasks yellow, zero out streaks
_.each user.tasks, (task) ->
task.value = 0
if task.type not 'reward'
task.value = 0
if task.type is 'daily'
task.streak = 0
# Reset all dynamic stats