From 62cf1265f8cd2790cc8154bce807b2b7fdfdb562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Fri, 26 Jan 2024 07:36:08 -0600 Subject: [PATCH 1/2] fix: no negative index --- src/hooks/useAppliedEquipments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useAppliedEquipments.ts b/src/hooks/useAppliedEquipments.ts index a65059b76..0342cfe9a 100644 --- a/src/hooks/useAppliedEquipments.ts +++ b/src/hooks/useAppliedEquipments.ts @@ -6,5 +6,5 @@ export function useAppliedEquipments( preset: EquipmentPreset, ) { const flatMatrix = matrix.flat(); - return preset.flat().map((options, index) => options[flatMatrix[index]]); + return preset.flat().map((options, index) => options[flatMatrix[index]] == 1 ? 1 : 0); } From a0df425115eb73659fe8a0f97bb8725e3056df81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Fri, 26 Jan 2024 07:38:42 -0600 Subject: [PATCH 2/2] fix: oops --- src/hooks/useAppliedEquipments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useAppliedEquipments.ts b/src/hooks/useAppliedEquipments.ts index 0342cfe9a..1f9d869df 100644 --- a/src/hooks/useAppliedEquipments.ts +++ b/src/hooks/useAppliedEquipments.ts @@ -6,5 +6,5 @@ export function useAppliedEquipments( preset: EquipmentPreset, ) { const flatMatrix = matrix.flat(); - return preset.flat().map((options, index) => options[flatMatrix[index]] == 1 ? 1 : 0); + return preset.flat().map((options, index) => options[flatMatrix[index] == 1 ? 1 : 0]); }