mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
fix(quests): repair negative quest scrolls on purchase (#10953)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
b2d6a9474d
commit
df860c9401
@@ -66,7 +66,7 @@ export class BuyQuestWithGoldOperation extends AbstractGoldItemOperation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
executeChanges (user, item, req) {
|
executeChanges (user, item, req) {
|
||||||
user.items.quests[item.key] = user.items.quests[item.key] || 0;
|
if (!user.items.quests[item.key] || user.items.quests[item.key] < 0) user.items.quests[item.key] = 0;
|
||||||
user.items.quests[item.key] += this.quantity;
|
user.items.quests[item.key] += this.quantity;
|
||||||
|
|
||||||
this.subtractCurrency(user, item, this.quantity);
|
this.subtractCurrency(user, item, this.quantity);
|
||||||
|
|||||||
Reference in New Issue
Block a user