Revert "Show accurate XP gain in notification on level up (#10590)"

This reverts commit 1f7dd421d4.
This commit is contained in:
Sabe Jones
2018-08-31 16:02:14 -05:00
parent 32a22f1545
commit c8d874d28a
2 changed files with 2 additions and 8 deletions

View File

@@ -88,7 +88,6 @@ import axios from 'axios';
import moment from 'moment'; import moment from 'moment';
import throttle from 'lodash/throttle'; import throttle from 'lodash/throttle';
import { toNextLevel } from '../../common/script/statHelpers';
import { shouldDo } from '../../common/script/cron'; import { shouldDo } from '../../common/script/cron';
import { mapState } from 'client/libs/store'; import { mapState } from 'client/libs/store';
import notifications from 'client/mixins/notifications'; import notifications from 'client/mixins/notifications';
@@ -223,12 +222,7 @@ export default {
userExp (after, before) { userExp (after, before) {
if (after === before) return; if (after === before) return;
if (this.user.stats.lvl === 0) return; if (this.user.stats.lvl === 0) return;
this.exp(after - before);
let exp = after - before;
if (exp < -50) { // recalculate exp if user level up
exp = toNextLevel(this.user.stats.lvl - 1) - before + after;
}
this.exp(exp);
}, },
userGp (after, before) { userGp (after, before) {
if (after === before) return; if (after === before) return;

View File

@@ -47,6 +47,6 @@ export function round (number, nDigits) {
} }
export function getXPMessage (val) { export function getXPMessage (val) {
if (val < -50) return; // don't show when they multi-level up (resetting their exp) if (val < -50) return; // don't show when they level up (resetting their exp)
return `${getSign(val)} ${round(val)}`; return `${getSign(val)} ${round(val)}`;
} }