From ad4eb6ef76663786d702adeb54ed072a6feb08ff Mon Sep 17 00:00:00 2001 From: Vikeo Date: Sun, 27 Aug 2023 16:26:15 +0200 Subject: [PATCH] do not allow less than zero on extra counters --- src/Components/Counters/ExtraCountersBar.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Components/Counters/ExtraCountersBar.tsx b/src/Components/Counters/ExtraCountersBar.tsx index 2d2da25..a420aea 100644 --- a/src/Components/Counters/ExtraCountersBar.tsx +++ b/src/Components/Counters/ExtraCountersBar.tsx @@ -51,6 +51,10 @@ const ExtraCountersBar = ({ updatedCounterTotal: number, type: CounterType ) => { + if (updatedCounterTotal < 0) { + return; + } + const existingCounter = player.extraCounters.find( (counter) => counter.type === type );