mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
mounts: block creating mount if they already have it
This commit is contained in:
@@ -122,8 +122,8 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
|
|||||||
|
|
||||||
// Saddling a pet
|
// Saddling a pet
|
||||||
if ($scope.selectedFood.name == 'Saddle') {
|
if ($scope.selectedFood.name == 'Saddle') {
|
||||||
if (userPets[pet] < 150)
|
if (userPets[pet] < 150) return Notification.text(egg+" is not strong enough yet to saddle.");
|
||||||
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;
|
if (!confirm('Saddle ' + pet + '?')) return;
|
||||||
userPets[pet] = 0;
|
userPets[pet] = 0;
|
||||||
setObj['items.mounts.' + pet] = true;
|
setObj['items.mounts.' + pet] = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user