pets: alert & return if they already own that pet

This commit is contained in:
Tyler Renelle 2013-03-25 09:31:12 -06:00
parent 5102b7fc51
commit f34df36152

View file

@ -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