From 24f1e282c1954cee25941e1fe31de3ff42119aa0 Mon Sep 17 00:00:00 2001 From: Oliver Salzburg Date: Wed, 28 Dec 2022 15:57:30 +0100 Subject: [PATCH] fix: Compiler complaints about resources --- packages/userscript/source/WorkshopManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/userscript/source/WorkshopManager.ts b/packages/userscript/source/WorkshopManager.ts index 56ba4fa2c..87ff6924e 100644 --- a/packages/userscript/source/WorkshopManager.ts +++ b/packages/userscript/source/WorkshopManager.ts @@ -401,10 +401,10 @@ export class WorkshopManager extends UpgradeManager implements Automation { // we *could* craft. if (resource.craftable) { let minProd = Number.MAX_VALUE; - const materials = this.getMaterials((resource as CraftableInfo).name); + const materials = this.getMaterials(resource.name as ResourceCraftable); for (const [mat, amount] of objectEntries(materials)) { const rat = - (1 + this._host.gamePage.getResCraftRatio((resource as CraftableInfo).name)) / amount; + (1 + this._host.gamePage.getResCraftRatio(resource.name as ResourceCraftable)) / amount; // Currently preTrade is only true for the festival stuff, so including furs from hunting is ideal. const addProd = this.getTickVal(this.getResource(mat)); if (addProd === "ignore") {