From 18f0755e4e539d323a5cf7a2c61563a5c266424e Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sun, 18 Aug 2013 20:42:27 -0400 Subject: [PATCH] cast user.items[type] to int, this was the "not enough gp" bug --- script/items.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/items.coffee b/script/items.coffee index 801ff541aa..e709faa66b 100644 --- a/script/items.coffee +++ b/script/items.coffee @@ -79,7 +79,7 @@ module.exports.buyItem = (user, type, options={}) -> nextItem = if type is 'potion' then items.potion - else module.exports.getItem type, ((user.items[type] or 0) + 1) + else module.exports.getItem type, ((~~user.items[type] or 0) + 1) return false if +user.stats.gp < +nextItem.value if nextItem.type is 'potion'