mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 12:40:00 +00:00
fix(quests): quests with a level cap cannot be bought before that level.
Users were buying the vice quest hoping to play it, not realizing it would drop at that level. Let's restrict buying the quest (at least in the short term) until you reach that level. Fixes #2707.
This commit is contained in:
parent
b01d08ccfe
commit
dab9ddbda2
1 changed files with 2 additions and 0 deletions
|
|
@ -142,6 +142,8 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', '$window', 'User',
|
|||
}
|
||||
$scope.buyQuest = function(quest) {
|
||||
var item = Content.quests[quest];
|
||||
if (item.lvl && item.lvl > user.stats.lvl)
|
||||
return alert("You must be level " + item.lvl + ' to buy this quest!');
|
||||
var completedPrevious = !item.previous || (User.user.achievements.quests && User.user.achievements.quests[item.previous]);
|
||||
if (!completedPrevious)
|
||||
return $scope.purchase("quests", item);
|
||||
|
|
|
|||
Loading…
Reference in a new issue