From 2c8bc4785e77e3c99167f6d5dc1299abe5032c96 Mon Sep 17 00:00:00 2001 From: ferricles Date: Fri, 13 May 2022 22:24:28 -0700 Subject: [PATCH] hotfix --- js/sq2builder.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/js/sq2builder.js b/js/sq2builder.js index 05124f8..b67268a 100644 --- a/js/sq2builder.js +++ b/js/sq2builder.js @@ -682,12 +682,13 @@ function updateArmorPowderSpecials(elem_id, recalc_stats) { } } else { - for (let i = 0; i < skp_names.length; ++i) { - skp_name = skp_names[i]; - skp_char = elem_chars[i]; - build.externalStats.set(skp_char + "DamPct", build.externalStats.get(skp_char + "DamPct") - document.getElementById(skp_name+"_boost_armor").value); - build.externalStats.get("damageBonus")[i] -= document.getElementById(skp_name+"_boost_armor").value; - + if (player_build !== undefined) { + for (let i = 0; i < skp_names.length; ++i) { + skp_name = skp_names[i]; + skp_char = elem_chars[i]; + player_build.externalStats.set(skp_char + "DamPct", player_build.externalStats.get(skp_char + "DamPct") - document.getElementById(skp_name+"_boost_armor").value); + player_build.externalStats.get("damageBonus")[i] -= document.getElementById(skp_name+"_boost_armor").value; + } } } @@ -704,7 +705,6 @@ function resetArmorPowderSpecials() { for (const skp of skp_names) { document.getElementById(skp + "_boost_armor").value = 0; document.getElementById(skp + "_boost_armor_prev").value = 0; - document.getElementById(skp + "_boost_armor").style.background = `linear-gradient(to right, #AAAAAA, #AAAAAA 0%, #AAAAAA 100%)`; }