HOTFIX: load crash bug with old versions

This commit is contained in:
hppeng 2022-12-17 01:11:19 -08:00
parent 98a3094491
commit 2f7ff17253
3 changed files with 16 additions and 5 deletions

View file

@ -104,6 +104,7 @@ async function load_old_version(version_str) {
clean_item(item); clean_item(item);
} }
let sets_ = result.sets; let sets_ = result.sets;
sets = new Map();
for (const set in sets_) { for (const set in sets_) {
sets.set(set, sets_[set]); sets.set(set, sets_[set]);
} }

View file

@ -133,11 +133,13 @@ async function load_tome_init() {
}); });
} }
let none_tomes = [ const none_tomes_info = [
["tome", "weaponTome", "No Weapon Tome"], ["tome", "weaponTome", "No Weapon Tome"],
["tome", "armorTome", "No Armor Tome"], ["tome", "armorTome", "No Armor Tome"],
["tome", "guildTome", "No Guild Tome"] ["tome", "guildTome", "No Guild Tome"]
]; ];
let none_tomes;
function init_tome_maps() { function init_tome_maps() {
//warp //warp
tomeMap = new Map(); tomeMap = new Map();
@ -149,12 +151,13 @@ function init_tome_maps() {
tomeLists.set(it, []); tomeLists.set(it, []);
} }
none_tomes = [];
for (let i = 0; i < 3; i++) { for (let i = 0; i < 3; i++) {
let tome = Object(); let tome = Object();
tome.slots = 0; tome.slots = 0;
tome.category = none_tomes[i][0]; tome.category = none_tomes_info[i][0];
tome.type = none_tomes[i][1]; tome.type = none_tomes_info[i][1];
tome.name = none_tomes[i][2]; tome.name = none_tomes_info[i][2];
tome.displayName = tome.name; tome.displayName = tome.name;
tome.set = null; tome.set = null;
tome.quest = null; tome.quest = null;
@ -173,7 +176,7 @@ function init_tome_maps() {
//dependency - load.js //dependency - load.js
clean_item(tome); clean_item(tome);
none_tomes[i] = tome; none_tomes.push(tome);
} }
tomes = tomes.concat(none_tomes); tomes = tomes.concat(none_tomes);
for (const tome of tomes) { for (const tome of tomes) {

View file

@ -95,6 +95,13 @@ translate_mappings = {
"airDamageBonus": "aDamPct", "airDamageBonus": "aDamPct",
"thunderDamageBonus": "tDamPct", "thunderDamageBonus": "tDamPct",
"earthDamageBonus": "eDamPct", "earthDamageBonus": "eDamPct",
"elementalDamageBonus": "rDamPct",
"fireDamageBonusRaw": "fDamRaw",
"waterDamageBonusRaw": "wDamRaw",
"airDamageBonusRaw": "aDamRaw",
"thunderDamageBonusRaw": "tDamRaw",
"earthDamageBonusRaw": "eDamRaw",
"elementalDamageBonusRaw": "rDamRaw",
"bonusFireDefense": "fDefPct", "bonusFireDefense": "fDefPct",
"bonusWaterDefense": "wDefPct", "bonusWaterDefense": "wDefPct",
"bonusAirDefense": "aDefPct", "bonusAirDefense": "aDefPct",