If the user selects an already selected pet, deselect it

This commit is contained in:
Daniel Saewitz
2013-03-16 15:10:50 -04:00
parent 6d34fa8953
commit 1a1144b3cc
+2
View File
@@ -31,6 +31,8 @@ module.exports.app = (appExports, model) ->
pet.str = petStr
ownsThisPet = user.get('items.pets').indexOf petStr
if ownsThisPet != -1
if user.get('items.currentPet').str is petStr
pet = {}
user.set 'items.currentPet', pet
else
tokens = user.get('balance')*4