Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
fix(religion): Unlocking Apocrypha crashes KS
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Jun 1, 2022
1 parent 8d148f6 commit 65520e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/userscript/source/BulkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,11 @@ export class BulkManager {
source?: "bonfire" | "space"
): number {
// If the building has stages, use the ratio for the current stage.
const ratio = mustExist(
const ratio =
// TODO: This seems weird. Why not take the price ratio of the stage as the default?
this._isStagedBuild(data)
? data.priceRatio || data.stages[data.stage].priceRatio
: data.priceRatio
);
: data.priceRatio ?? 0;

let ratioDiff = 0;
if (source && source === "bonfire") {
Expand Down
2 changes: 1 addition & 1 deletion packages/userscript/source/types/religion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export type TranscendenceUpgradeInfo = AbstractReligionUpgradeInfo & {
flavor: string;

name: TranscendenceUpgrades;
priceRatio: number;
priceRatio?: number;
tier: number;
unlocks: {
zigguratUpgrades: Array<"ivoryTower">;
Expand Down

0 comments on commit 65520e0

Please sign in to comment.