From a0faa3ea0530bdc477afa5516bfcb2058aa0636f Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 6 May 2013 19:51:15 +0100 Subject: [PATCH] allow buying when tokens == item.value --- src/app/pets.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pets.coffee b/src/app/pets.coffee index 023cbaa84e..4197c1a351 100644 --- a/src/app/pets.coffee +++ b/src/app/pets.coffee @@ -54,7 +54,7 @@ module.exports.app = (appExports, model) -> name = $(el).attr 'data-hatchingPotion' newHatchingPotion = _.findWhere hatchingPotions, name: name tokens = user.get('balance') * 4 - if tokens > newHatchingPotion.value + if tokens >= newHatchingPotion.value if confirm "Buy this hatching potion with #{newHatchingPotion.value} of your #{tokens} tokens?" user.push 'items.hatchingPotions', newHatchingPotion.name user.set 'balance', (tokens - newHatchingPotion.value) / 4 @@ -65,7 +65,7 @@ module.exports.app = (appExports, model) -> name = $(el).attr 'data-egg' newEgg = _.findWhere pets, name: name tokens = user.get('balance') * 4 - if tokens > newEgg.value + if tokens >= newEgg.value if confirm "Buy this egg with #{newEgg.value} of your #{tokens} tokens?" user.push 'items.eggs', newEgg user.set 'balance', (tokens - newEgg.value) / 4