From 4780e6cd2cd58a33a289123a0de5675bb6e5903a Mon Sep 17 00:00:00 2001 From: b Date: Sat, 27 Mar 2021 15:09:16 -0700 Subject: [PATCH] Round near fix.. --- damage_calc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/damage_calc.js b/damage_calc.js index 340e4a0..338cd6e 100644 --- a/damage_calc.js +++ b/damage_calc.js @@ -42,7 +42,7 @@ function calculateSpellDamage(stats, spellConversions, rawModifier, pctModifier, let damageBases = buildStats.get("damageBases").slice(); for (const p of powders) { let powder = powderStats[p]; //use min, max, and convert - let element = round_near(p/6); + let element = Math.floor((p+0.01)/6); //[0,4], the +0.01 attempts to prevent division error let diff = Math.floor(damageBases[0] * powder.convert/100); damageBases[0] -= diff; damageBases[element+1] += diff + Math.floor( (powder.min + powder.max) / 2 );