Added exp reset when changing level (#9611)

This commit is contained in:
Keith Holliday
2017-11-30 15:45:26 -06:00
committed by GitHub
parent 7797794cd5
commit c6a3bfb291

View File

@@ -85,6 +85,10 @@ export default {
return;
}
const userChangedLevel = this.restoreValues.stats.lvl !== this.user.stats.lvl;
const userDidNotChangeExp = this.restoreValues.stats.exp === this.user.stats.exp;
if (userChangedLevel && userDidNotChangeExp) this.restoreValues.stats.exp = 0;
this.user.stats = clone(this.restoreValues.stats);
this.user.achievements.streak = clone(this.restoreValues.achievements.streak);