do not allow less than zero on extra counters

This commit is contained in:
Vikeo
2023-08-27 16:26:15 +02:00
parent 390a0f1b71
commit ad4eb6ef76

View File

@@ -51,6 +51,10 @@ const ExtraCountersBar = ({
updatedCounterTotal: number, updatedCounterTotal: number,
type: CounterType type: CounterType
) => { ) => {
if (updatedCounterTotal < 0) {
return;
}
const existingCounter = player.extraCounters.find( const existingCounter = player.extraCounters.find(
(counter) => counter.type === type (counter) => counter.type === type
); );