Merge pull request #3535 from OverloadUT/fix-spells-mana-check

API rejects spell cast if not enough mana
This commit is contained in:
Tyler Renelle
2014-06-06 15:56:34 -06:00
2 changed files with 9 additions and 5 deletions
+1
View File
@@ -302,6 +302,7 @@ api.cast = function(req, res, next) {
var klass = shared.content.spells.special[req.params.spell] ? 'special' : user.stats.class
var spell = shared.content.spells[klass][req.params.spell];
if (!spell) return res.json(404, {err: 'Spell "' + req.params.spell + '" not found.'});
if (spell.mana > user.stats.mp) return res.json(400, {err: 'Not enough mana to cast spell'});
var done = function(){
var err = arguments[0];