Moved the beastMaster modal alert from notifications to inside the hatching function

This commit is contained in:
Blade Barringer 2015-01-02 18:52:25 -06:00
parent e1494b3860
commit 9b82da064f
2 changed files with 7 additions and 11 deletions

View file

@ -85,6 +85,13 @@ habitrpg.controller("InventoryCtrl",
user.ops.hatch({params:{egg:egg.key, hatchingPotion:potion.key}});
$scope.selectedEgg = null;
$scope.selectedPotion = null;
// Checks if beastmaster has been reached for the first time
if(!User.user.achievements.beastMaster
&& Shared.countPets(null, User.user.items.pets) >= 90) {
User.user.achievements.beastMaster = true;
$rootScope.openModal('achievements/beastMaster');
}
}
$scope.purchase = function(type, item){

View file

@ -104,17 +104,6 @@ habitrpg.controller('NotificationCtrl',
$rootScope.openModal('achievements/ultimateGear');
});
// Watches number of pets and displays beastMaster modal when 90 are found
$rootScope.$watch('user.items.pets', function(after, before){
if(_.size(after) === _.size(before) ||
Shared.countPets(null, after) < 90) return;
if (User.user.achievements.beastMaster == undefined) {
User.user.achievements.beastMaster = true;
$rootScope.openModal('achievements/beastMaster');
}
}, true);
// Watches number of mounts and displays mountMaster modal when 90 are raised
$rootScope.$watch('user.items.mounts', function(after, before){
if(_.size(after) === _.size(before) ||