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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user