From 3d6d6322e8c718a52e95446fe32d4a7d53fd3647 Mon Sep 17 00:00:00 2001 From: undefined Date: Tue, 30 Dec 2025 18:52:52 +0800 Subject: [PATCH] fix: negative resistance with polarized modules (#167) --- src/components/ShipAttribute/ShipAttribute.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ShipAttribute/ShipAttribute.tsx b/src/components/ShipAttribute/ShipAttribute.tsx index 9ca5022..0d71212 100644 --- a/src/components/ShipAttribute/ShipAttribute.tsx +++ b/src/components/ShipAttribute/ShipAttribute.tsx @@ -109,6 +109,9 @@ export function useAttribute(type: "Ship" | "Char", props: AttributeProps): { va if (Object.is(value, -0)) { value = 0; } + if (props.isResistance) { + value = Math.max(value, 0); + } return { value: value.toLocaleString("en", {