cast user.items[type] to int, this was the "not enough gp" bug

This commit is contained in:
Tyler Renelle 2013-08-18 20:42:27 -04:00
parent b13c909fe7
commit 18f0755e4e

View file

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