bug fix: needed to kill user before checking their exp - tnl() >= 0

when lvl == 0

Conflicts:

	test/test.coffee
This commit is contained in:
Tyler Renelle
2012-09-18 01:04:03 -04:00
parent 38ebce3b56
commit 393033b1c2
3 changed files with 49 additions and 15 deletions

View File

@@ -33,13 +33,6 @@ hpModifier = function(user, value) {
updateStats = function(user, stats) {
var money, tnl;
if (stats.hp != null) {
if (stats.hp < 0) {
user.set('stats.lvl', 0);
} else {
user.set('stats.hp', stats.hp);
}
}
if (stats.exp != null) {
tnl = user.get('_tnl');
if (stats.exp >= tnl) {
@@ -61,6 +54,13 @@ updateStats = function(user, stats) {
}
user.set('stats.exp', stats.exp);
}
if (stats.hp != null) {
if (stats.hp < 0) {
user.set('stats.lvl', 0);
} else {
user.set('stats.hp', stats.hp);
}
}
if (stats.money != null) {
if (!(typeof money !== "undefined" && money !== null) || money < 0) {
money = 0.0;