Deep Clone spells multi-layer object

This commit is contained in:
ReznoRMichael 2020-08-26 01:25:25 +02:00
parent 9331d5bbca
commit 92543f661a

View file

@ -220,6 +220,9 @@ function HKCheckCompletion(jsonObject) {
let HK_LIFEBLOOD_temp = Object.assign({}, HK_LIFEBLOOD); let HK_LIFEBLOOD_temp = Object.assign({}, HK_LIFEBLOOD);
let HK_GODMASTER_temp = Object.assign({}, HK_GODMASTER); let HK_GODMASTER_temp = Object.assign({}, HK_GODMASTER);
// Deep Clone const spells multi-layer object (used for destructive functions)
let HK_SPELLS_temp = JSON.parse(JSON.stringify(HK_SPELLS));
let HKPlayerData = jsonObject.playerData; let HKPlayerData = jsonObject.playerData;
let bossDoor = ["Pantheon of the Master", "Pantheon of the Artist", "Pantheon of the Sage", "Pantheon of the Knight"]; let bossDoor = ["Pantheon of the Master", "Pantheon of the Artist", "Pantheon of the Sage", "Pantheon of the Knight"];
let nailName = ["Old Nail", "Sharpened Nail", "Channeled Nail", "Coiled Nail", "Pure Nail"]; let nailName = ["Old Nail", "Sharpened Nail", "Channeled Nail", "Coiled Nail", "Pure Nail"];
@ -280,7 +283,7 @@ function HKCheckCompletion(jsonObject) {
// ---------------- Spells --------------------- // // ---------------- Spells --------------------- //
if (HK_SPELLS) checkSpellLevel(DIV_ID.spells, HK_SPELLS, HKPlayerData); if (HK_SPELLS_temp) checkSpellLevel(DIV_ID.spells, HK_SPELLS_temp, HKPlayerData);
// ---------------- Vessel Fragments --------------------- // // ---------------- Vessel Fragments --------------------- //