From 53f502b96da6f66aec15082665c35d084d4bbbd8 Mon Sep 17 00:00:00 2001 From: hppeng Date: Thu, 30 Jun 2022 20:44:26 -0700 Subject: [PATCH] Bugfix pt. 2: Totals now are evaluated in second round --- js/builder_graph.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/js/builder_graph.js b/js/builder_graph.js index 048f582..28140fe 100644 --- a/js/builder_graph.js +++ b/js/builder_graph.js @@ -578,8 +578,17 @@ class SpellDamageCalcNode extends ComputeNode { type: "heal", heal_amount: _heal_amount } - } else if ('hits' in part) { - spell_result = { + } + else { + continue; + } + spell_result.name = part.name; + spell_results.push(spell_result); + spell_result_map.set(part.name, spell_result); + } + for (const part of spell_parts) { + if ('hits' in part) { + let spell_result = { normal_min: [0, 0, 0, 0, 0, 0], normal_max: [0, 0, 0, 0, 0, 0], normal_total: [0, 0], @@ -610,10 +619,10 @@ class SpellDamageCalcNode extends ComputeNode { spell_result.heal_amount += subpart.heal_amount; } } + spell_result.name = part.name; + spell_results.push(spell_result); + spell_result_map.set(part.name, spell_result); } - spell_result.name = part.name; - spell_results.push(spell_result); - spell_result_map.set(part.name, spell_result); } return spell_results; }