Fix undefined slots
This commit is contained in:
parent
2ac4ac2fef
commit
280e5cb643
1 changed files with 4 additions and 1 deletions
5
load.js
5
load.js
|
@ -1,4 +1,4 @@
|
|||
const DB_VERSION = 31;
|
||||
const DB_VERSION = 32;
|
||||
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.js
|
||||
|
||||
let db;
|
||||
|
@ -55,6 +55,9 @@ function clean_item(item) {
|
|||
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];
|
||||
if (item.slots === undefined) {
|
||||
item.slots = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue