mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-21 03:04:13 +00:00
cast user.items[type] to int, this was the "not enough gp" bug
This commit is contained in:
parent
b13c909fe7
commit
18f0755e4e
1 changed files with 1 additions and 1 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Reference in a new issue