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:
Cole Gleason 2014-02-02 01:51:51 -06:00
parent b01d08ccfe
commit dab9ddbda2

View file

@ -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);