From ecf3763c3736aec27f14477eba0e6bc0d0794ed2 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 26 Jan 2023 23:28:38 +0200 Subject: [PATCH] Fix 1 main of ISS on Autobomb showing 50% ink consumption --- app/features/build-analyzer/core/stats.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/features/build-analyzer/core/stats.ts b/app/features/build-analyzer/core/stats.ts index edf902f99..442cc46e8 100644 --- a/app/features/build-analyzer/core/stats.ts +++ b/app/features/build-analyzer/core/stats.ts @@ -223,7 +223,12 @@ function subWeaponInkConsumptionPercentage(args: StatFunctionInput) { return { modifiedBy: "ISS" as const, baseValue: roundToNDecimalPlaces(args.subWeaponParams.InkConsume * 100), - value: roundToNDecimalPlaces(subWeaponConsume(args).inkConsume * 100), + value: roundToNDecimalPlaces( + // + 0.004 is a hack to avoid situation where the value is e.g. 50.0005 + // -> rounds to 50% so it appears you can throw two subs + // which is not correct so we force the round upwards + subWeaponConsume(args).inkConsume * 100 + 0.0045 + ), }; }