From 1548d0a76fe650cfd32278ec89e8ee80b24d1747 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Tue, 27 May 2025 18:30:08 -0700 Subject: [PATCH] fix zod validation on units due to malformed array --- src/core/game/StatsImpl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/game/StatsImpl.ts b/src/core/game/StatsImpl.ts index 2546fa2cb..3ccd06233 100644 --- a/src/core/game/StatsImpl.ts +++ b/src/core/game/StatsImpl.ts @@ -118,7 +118,7 @@ export class StatsImpl implements Stats { if (p === undefined) return; if (p.units === undefined) p.units = { [type]: [0] }; if (p.units[type] === undefined) p.units[type] = [0]; - while (p.units[type].length < index) p.units[type].push(0); + while (p.units[type].length <= index) p.units[type].push(0); p.units[type][index] += value; }