From 5405da365b341e8326df59f75a1183c877334482 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 12:58:41 -0600 Subject: [PATCH] feat: generalized include check --- .../components/Configure/components/Provisions.tsx | 1 - src/app/tools/tankopedia/[id]/page.tsx | 10 +++++++++- src/core/blitzkrieg/checkConsumableInclusivity.ts | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/tools/tankopedia/[id]/components/Configure/components/Provisions.tsx b/src/app/tools/tankopedia/[id]/components/Configure/components/Provisions.tsx index 6b095ad4d..0c9fb0550 100644 --- a/src/app/tools/tankopedia/[id]/components/Configure/components/Provisions.tsx +++ b/src/app/tools/tankopedia/[id]/components/Configure/components/Provisions.tsx @@ -30,7 +30,6 @@ export function Provisions() { {provisionsList.map((provision, index) => { - if (provision.id === 113) return null; // goofy useless provision const selected = provisions.includes(provision.id); return ( diff --git a/src/app/tools/tankopedia/[id]/page.tsx b/src/app/tools/tankopedia/[id]/page.tsx index ad20838f6..d4e1c7272 100644 --- a/src/app/tools/tankopedia/[id]/page.tsx +++ b/src/app/tools/tankopedia/[id]/page.tsx @@ -38,7 +38,15 @@ export default function Page({ params }: { params: { id: string } }) { mutateTankopediaTemporary((draft) => { draft.model.pose.yaw = 0; draft.model.pose.pitch = 0; - draft.mode = 'armor'; + draft.mode = 'model'; + draft.consumables = []; + draft.provisions = []; + draft.camouflage = false; + draft.equipmentMatrix = [ + [0, 0, 0], + [0, 0, 0], + [0, 0, 0], + ]; }); function handleKeyDown(event: KeyboardEvent) { diff --git a/src/core/blitzkrieg/checkConsumableInclusivity.ts b/src/core/blitzkrieg/checkConsumableInclusivity.ts index 907e852f5..27083a6f0 100644 --- a/src/core/blitzkrieg/checkConsumableInclusivity.ts +++ b/src/core/blitzkrieg/checkConsumableInclusivity.ts @@ -43,5 +43,5 @@ export function checkConsumableProvisionInclusivity( } }); - return included && !excluded; + return consumableProvision.include.length > 0 && included && !excluded; }