From d0d75d11787f0aaf105bc6dfbcf1983ff23f80a0 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 24 Dec 2022 09:26:42 -0600 Subject: [PATCH] Fixed random freeze I got --- src/data/layers/factory.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index 0ee9fec..853a97e 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -912,6 +912,13 @@ const factory = createLayer(id, () => { } while (times > 0) { + if ( + !Object.values(allToys).some(i => + Decimal.gte(i.value, computedToyMultiplier.value) + ) + ) { + return; + } while (Decimal.lt(value[toysIndex].value, computedToyMultiplier.value)) { toysIndex = (toysIndex + 1) % value.length; }