From 327df35380db3be2c34a84fdcf8c07da1ae65a98 Mon Sep 17 00:00:00 2001 From: Igor <12849336+DoubleCookies@users.noreply.github.com> Date: Sat, 29 Oct 2022 10:17:27 +0300 Subject: [PATCH] Disable double torpedos in analyzer (#1058) * Note about torpedo * no magic numbers -> constant --- app/routes/analyzer.tsx | 4 +++- public/locales/en/analyzer.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index 11e6fc99d..47d77b2fe 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -30,6 +30,7 @@ import { SPLASH_WALL_ID, SPRINKLER_ID, TOXIC_MIST_ID, + TORPEDO_ID, type BuildAbilitiesTupleWithUnknown, type MainWeaponId, type SubWeaponId, @@ -895,7 +896,7 @@ function ConsumptionTable({ subWeaponId: SubWeaponId; }) { const { t } = useTranslation(["analyzer", "weapons"]); - const maxSubsToUse = Math.max(...options.map((opt) => opt.subsUsed)); + const maxSubsToUse = subWeaponId === TORPEDO_ID ? 1 : Math.max(...options.map((opt) => opt.subsUsed)); const types = Array.from(new Set(options.map((opt) => opt.type))); return ( @@ -926,6 +927,7 @@ function ConsumptionTable({