mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
pets: alert & return if they already own that pet
This commit is contained in:
parent
5102b7fc51
commit
f34df36152
1 changed files with 1 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ module.exports.app = (appExports, model) ->
|
|||
|
||||
return alert "You don't own that food :\\" if foodIdx is -1
|
||||
return alert "You don't own that egg :\\" if eggIdx is -1
|
||||
return alert "You already have that pet." if user.get('items.pets').indexOf("#{egg.name}-#{foodName}") != -1
|
||||
|
||||
user.push 'items.pets', egg.name + '-' + foodName
|
||||
user.remove 'items.food', foodIdx, 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue