pets: alert & return if they already own that pet
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user