tests: Update updateStats test

This commit is contained in:
Blade Barringer
2015-12-26 19:52:25 -06:00
parent 1b118d86b2
commit 80ed048d5c
2 changed files with 41 additions and 16 deletions
+1 -2
View File
@@ -2272,13 +2272,12 @@ api.wrap = function(user, main) {
})()]++;
},
updateStats: function(stats, req, analytics) {
var tnl;
if (stats.hp <= 0) {
return user.stats.hp = 0;
}
user.stats.hp = stats.hp;
user.stats.gp = stats.gp >= 0 ? stats.gp : 0;
tnl = api.tnl(user.stats.lvl);
var tnl = api.tnl(user.stats.lvl);
if (stats.exp >= tnl) {
user.stats.exp = stats.exp;
while (stats.exp >= tnl) {