mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
Merge branch 'release' into develop
This commit is contained in:
commit
e98c943541
6 changed files with 14 additions and 5 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "habitica",
|
||||
"version": "4.184.0",
|
||||
"version": "4.184.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "habitica",
|
||||
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
||||
"version": "4.184.0",
|
||||
"version": "4.184.1",
|
||||
"main": "./website/server/index.js",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.12.10",
|
||||
|
|
|
|||
|
|
@ -151,6 +151,8 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.restoreValues.stats.lvl > 999) this.restoreValues.stats.lvl = 999;
|
||||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ api.getWorldState = {
|
|||
const worldState = {};
|
||||
|
||||
worldState.worldBoss = await getWorldBoss();
|
||||
worldState.npcImageSuffix = 'spring';
|
||||
worldState.npcImageSuffix = '';
|
||||
|
||||
worldState.currentEvent = getCurrentEvent();
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,9 @@ export async function update (req, res, { isV3 = false }) {
|
|||
user.flags.lastNewStuffRead = lastNewsPost._id;
|
||||
}
|
||||
} else if (acceptablePUTPaths[key]) {
|
||||
_.set(user, key, val);
|
||||
let adjustedVal = val;
|
||||
if (key === 'stats.lvl' && val > 999) adjustedVal = 999;
|
||||
_.set(user, key, adjustedVal);
|
||||
} else {
|
||||
throw new NotAuthorized(res.t('messageUserOperationProtected', { operation: key }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -592,7 +592,12 @@ export default new Schema({
|
|||
mp: { $type: Number, default: 10 },
|
||||
exp: { $type: Number, default: 0 },
|
||||
gp: { $type: Number, default: 0 },
|
||||
lvl: { $type: Number, default: 1, min: 1 },
|
||||
lvl: {
|
||||
$type: Number,
|
||||
default: 1,
|
||||
min: 1,
|
||||
max: 999,
|
||||
},
|
||||
|
||||
// Class System
|
||||
class: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue