woops, can't alert on server!

This commit is contained in:
Tyler Renelle
2013-08-15 00:26:39 -04:00
parent 2ffade083e
commit d7083bd442
3 changed files with 4357 additions and 4361 deletions
+1 -3
View File
@@ -83,9 +83,7 @@ module.exports.buyItem = (user, type, options={}) ->
i = (user.items[type] or 0) + 1
module.exports.getItem type, i
if user.stats.gp < +nextItem.value
alert("Not enough GP")
return false
return false if user.stats.gp < +nextItem.value
if nextItem.type is 'potion'
user.stats.hp += 15;
user.stats.hp = 50 if user.stats.hp > 50