forked from profectus/Profectus
Fix repeatables not buying max correctly
This commit is contained in:
parent
9fa5ec971a
commit
d4f0069dd5
1 changed files with 8 additions and 3 deletions
|
@ -162,7 +162,8 @@ export function createRepeatable<T extends RepeatableOptions>(
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
requiresPay: false,
|
requiresPay: false,
|
||||||
visibility: Visibility.None
|
visibility: Visibility.None,
|
||||||
|
canMaximize: true
|
||||||
} as const;
|
} as const;
|
||||||
const visibilityRequirement = createVisibilityRequirement(repeatable as GenericRepeatable);
|
const visibilityRequirement = createVisibilityRequirement(repeatable as GenericRepeatable);
|
||||||
if (isArray(repeatable.requirements)) {
|
if (isArray(repeatable.requirements)) {
|
||||||
|
@ -205,8 +206,12 @@ export function createRepeatable<T extends RepeatableOptions>(
|
||||||
if (!unref(genericRepeatable.canClick)) {
|
if (!unref(genericRepeatable.canClick)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
payRequirements(repeatable.requirements, unref(repeatable.amountToIncrease));
|
const amountToIncrease = unref(repeatable.amountToIncrease) ?? 1;
|
||||||
genericRepeatable.amount.value = Decimal.add(genericRepeatable.amount.value, 1);
|
payRequirements(repeatable.requirements, amountToIncrease);
|
||||||
|
genericRepeatable.amount.value = Decimal.add(
|
||||||
|
genericRepeatable.amount.value,
|
||||||
|
amountToIncrease
|
||||||
|
);
|
||||||
onClick?.(event);
|
onClick?.(event);
|
||||||
};
|
};
|
||||||
processComputable(repeatable as T, "display");
|
processComputable(repeatable as T, "display");
|
||||||
|
|
Loading…
Reference in a new issue