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

Commit

Permalink
fix(core): Staged buildings not built
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Oct 11, 2022
1 parent 3ba6ba5 commit 679388f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/userscript/source/helper/BulkPurchaseHelper.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { BonfireItem } from "../options/BonfireSettings";
import { AllItems, Requirement } from "../options/Settings";
import { objectEntries } from "../tools/Entries";
import { isNil, mustExist } from "../tools/Maybe";
import {
AllBuildings,
BuildButton,
Building,
BuildingMeta,
ChronoForgeUpgradeInfo,
Price,
Expand Down Expand Up @@ -54,7 +56,8 @@ export class BulkPurchaseHelper {
enabled: boolean;
label?: string;
max?: number;
name?: AllBuildings;
baseBuilding?: Building;
building?: AllBuildings | BonfireItem;
require?: Requirement;
stage?: number;
variant?: TimeItemVariant | UnicornItemVariant;
Expand Down Expand Up @@ -188,15 +191,15 @@ export class BulkPurchaseHelper {
count: 0,
id: name,
label: build.label,
name: build.name,
name: (build.baseBuilding ?? build.building) as Building,
stage: build.stage,
variant: build.variant,
});

// Create an entry in the cache list for the bulk processing.
potentialBuilds.push({
id: name,
name: build.name,
name: (build.baseBuilding ?? build.building) as Building,
count: 0,
spot: counter,
prices: itemPrices,
Expand Down Expand Up @@ -238,6 +241,15 @@ export class BulkPurchaseHelper {
* Calculate how many of a given build item build be built with the given resources.
*
* @param buildCacheItem The item to build.
* @param buildCacheItem.id ?
* @param buildCacheItem.name ?
* @param buildCacheItem.count ?
* @param buildCacheItem.spot ?
* @param buildCacheItem.prices ?
* @param buildCacheItem.priceRatio ?
* @param buildCacheItem.source ?
* @param buildCacheItem.limit ?
* @param buildCacheItem.val ?
* @param metaData The metadata for the potential builds.
* @param resources The currently available resources.
* @returns The number of items that could be built. If this is non-zero, the `resources` will have been adjusted
Expand Down

0 comments on commit 679388f

Please sign in to comment.