Fill in undefined skp bonus
This commit is contained in:
parent
d19a7f79e6
commit
51331aa394
2 changed files with 10 additions and 10 deletions
10
load.js
10
load.js
|
@ -1,4 +1,4 @@
|
||||||
const DB_VERSION = 43;
|
const DB_VERSION = 45;
|
||||||
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA
|
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA
|
||||||
|
|
||||||
let db;
|
let db;
|
||||||
|
@ -61,12 +61,12 @@ function clean_item(item) {
|
||||||
item.displayName = item.name;
|
item.displayName = item.name;
|
||||||
}
|
}
|
||||||
item.skillpoints = [item.str, item.dex, item.int, item.def, item.agi];
|
item.skillpoints = [item.str, item.dex, item.int, item.def, item.agi];
|
||||||
item.has_negstat = item.str < 0 || item.dex < 0 || item.int < 0 || item.def < 0 || item.agi < 0;
|
|
||||||
item.reqs = [item.strReq, item.dexReq, item.intReq, item.defReq, item.agiReq];
|
item.reqs = [item.strReq, item.dexReq, item.intReq, item.defReq, item.agiReq];
|
||||||
|
item.has_negstat = false;
|
||||||
for (let i = 0; i < 5; ++i) {
|
for (let i = 0; i < 5; ++i) {
|
||||||
if (item.reqs[i] === undefined) {
|
if (item.reqs[i] === undefined) { item.reqs[i] = 0; }
|
||||||
item.reqs[i] = 0;
|
if (item.skillpoints[i] === undefined) { item.skillpoints[i] = 0; }
|
||||||
}
|
if (item.skillpoints[i] < 0) { item.has_negstat = true; }
|
||||||
}
|
}
|
||||||
if (item.slots === undefined) {
|
if (item.slots === undefined) {
|
||||||
item.slots = 0
|
item.slots = 0
|
||||||
|
|
10
load3.js
10
load3.js
|
@ -1,4 +1,4 @@
|
||||||
const DB_VERSION = 44;
|
const DB_VERSION = 45;
|
||||||
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA
|
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.jsA
|
||||||
|
|
||||||
let db;
|
let db;
|
||||||
|
@ -61,12 +61,12 @@ function clean_item(item) {
|
||||||
item.displayName = item.name;
|
item.displayName = item.name;
|
||||||
}
|
}
|
||||||
item.skillpoints = [item.str, item.dex, item.int, item.def, item.agi];
|
item.skillpoints = [item.str, item.dex, item.int, item.def, item.agi];
|
||||||
item.has_negstat = item.str < 0 || item.dex < 0 || item.int < 0 || item.def < 0 || item.agi < 0;
|
|
||||||
item.reqs = [item.strReq, item.dexReq, item.intReq, item.defReq, item.agiReq];
|
item.reqs = [item.strReq, item.dexReq, item.intReq, item.defReq, item.agiReq];
|
||||||
|
item.has_negstat = false;
|
||||||
for (let i = 0; i < 5; ++i) {
|
for (let i = 0; i < 5; ++i) {
|
||||||
if (item.reqs[i] === undefined) {
|
if (item.reqs[i] === undefined) { item.reqs[i] = 0; }
|
||||||
item.reqs[i] = 0;
|
if (item.skillpoints[i] === undefined) { item.skillpoints[i] = 0; }
|
||||||
}
|
if (item.skillpoints[i] < 0) { item.has_negstat = true; }
|
||||||
}
|
}
|
||||||
if (item.slots === undefined) {
|
if (item.slots === undefined) {
|
||||||
item.slots = 0;
|
item.slots = 0;
|
||||||
|
|
Loading…
Reference in a new issue