mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
Only refund quest scroll to leader if quest was active
otherwise quest leader gets more quest scrolls than they had to begin with.
This commit is contained in:
parent
74d206ab74
commit
e01ff99610
1 changed files with 5 additions and 5 deletions
|
|
@ -607,11 +607,11 @@ api.questAbort = function(req, res, next){
|
||||||
},
|
},
|
||||||
// Refund party leader quest scroll
|
// Refund party leader quest scroll
|
||||||
function(cb){
|
function(cb){
|
||||||
var update = {$inc:{}};
|
if (group.quest.active) {
|
||||||
update['$inc']['items.quests.' + group.quest.key] = 1;
|
var update = {$inc:{}};
|
||||||
User.update({_id:group.quest.leader}, update, cb);
|
update['$inc']['items.quests.' + group.quest.key] = 1;
|
||||||
},
|
User.update({_id:group.quest.leader}, update, cb);
|
||||||
function(cb) {
|
}
|
||||||
group.quest = {key:null,progress:{},leader:null};
|
group.quest = {key:null,progress:{},leader:null};
|
||||||
group.markModified('quest');
|
group.markModified('quest');
|
||||||
group.save(cb);
|
group.save(cb);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue