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

Commit

Permalink
fix(workshop): Remove references to limRat
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Sep 30, 2022
1 parent 94de71d commit b6dde47
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/userscript/source/WorkshopManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ export class WorkshopManager extends UpgradeManager implements Automation {

// Craft the resource if it doesn't require anything or we hit the requirement trigger.
if (!require || trigger <= require.value / require.maxValue) {
amount = this.getLowestCraftAmount(name, craft.limited, craft.limRat, true);
amount = this.getLowestCraftAmount(name, craft.limited, true);

// If a resource DOES "require" another resource AND its trigger value has NOT been hit
// yet AND it is limited... What?
} else if (craft.limited) {
amount = this.getLowestCraftAmount(name, craft.limited, craft.limRat, false);
amount = this.getLowestCraftAmount(name, craft.limited, false);
}

// If we can craft any of this item, do it.
Expand Down Expand Up @@ -219,15 +219,13 @@ export class WorkshopManager extends UpgradeManager implements Automation {
*
* @param name The resource to craft.
* @param limited Is the crafting of the resource currently limited?
* @param limRat ?
* @param requiredResourceAboveTrigger Is the resource that is required for
* this craft currently above the trigger value?
* @returns ?
*/
getLowestCraftAmount(
name: ResourceCraftable,
limited: boolean,
limRat: number,
requiredResourceAboveTrigger: boolean
): number {
const materials = this.getMaterials(name);
Expand Down

0 comments on commit b6dde47

Please sign in to comment.