From d4f0069dd52cf84a377c9e08f62d19d2ac85f6bc Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 12 May 2023 17:07:37 -0500 Subject: [PATCH] Fix repeatables not buying max correctly --- src/features/repeatable.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/features/repeatable.tsx b/src/features/repeatable.tsx index eb34af5..f45d7d3 100644 --- a/src/features/repeatable.tsx +++ b/src/features/repeatable.tsx @@ -162,7 +162,8 @@ export function createRepeatable( ) ), requiresPay: false, - visibility: Visibility.None + visibility: Visibility.None, + canMaximize: true } as const; const visibilityRequirement = createVisibilityRequirement(repeatable as GenericRepeatable); if (isArray(repeatable.requirements)) { @@ -205,8 +206,12 @@ export function createRepeatable( if (!unref(genericRepeatable.canClick)) { return; } - payRequirements(repeatable.requirements, unref(repeatable.amountToIncrease)); - genericRepeatable.amount.value = Decimal.add(genericRepeatable.amount.value, 1); + const amountToIncrease = unref(repeatable.amountToIncrease) ?? 1; + payRequirements(repeatable.requirements, amountToIncrease); + genericRepeatable.amount.value = Decimal.add( + genericRepeatable.amount.value, + amountToIncrease + ); onClick?.(event); }; processComputable(repeatable as T, "display");