HabitRPG/habitrpg-shared — pull request #136 by brandonjreid (2014-02-08 18:10:15+00:00)
Title: Update stats after casting spell

I could be wrong, but I think this is all we need to do to fix those issues of not leveling up after casting spells (Burst of Flames, and Backstab). Typically updateStats is called with a temporary stats object, but since all of the spells update user.stats we should just be able to call it with user.stats as the parameter.

It causes some of the statements in updateStats to not do anything (e.g. user.stats.gp = stats.gp), but I don't see it causing any issues. Instead of decrementing the exp from a temporary stats object, it just decrements it from user.stats before increasing the level by 1.

Fixes issue #2143 and #2598.