mounts: block creating mount if they already have it

This commit is contained in:
Tyler Renelle
2013-11-10 15:13:50 -08:00
parent 244fe63bdd
commit 4c15905cd9

View File

@@ -122,8 +122,8 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
// Saddling a pet
if ($scope.selectedFood.name == 'Saddle') {
if (userPets[pet] < 150)
return Notification.text(egg+" is not strong enough yet to saddle.");
if (userPets[pet] < 150) return Notification.text(egg+" is not strong enough yet to saddle.");
if (user.items.mounts[pet]) return Notification.text("You already have that mount");
if (!confirm('Saddle ' + pet + '?')) return;
userPets[pet] = 0;
setObj['items.mounts.' + pet] = true;