From 1e6e635ae38740be5143e27557ab302ac27c7768 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Fri, 26 Jul 2024 03:05:29 -0600 Subject: [PATCH] BUGFIX: Correctly show remaining grafting/programming time left when cycles are skipped. (#1510) --- src/Work/CreateProgramWork.ts | 4 ++-- src/Work/GraftingWork.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Work/CreateProgramWork.ts b/src/Work/CreateProgramWork.ts index 56a25d9c7..0b087d00e 100644 --- a/src/Work/CreateProgramWork.ts +++ b/src/Work/CreateProgramWork.ts @@ -64,8 +64,8 @@ export class CreateProgramWork extends Work { skillMult *= focusBonus; //Skill multiplier directly applied to "time worked" this.cyclesWorked += cycles; - this.unitRate = CONSTANTS.MilliPerCycle * cycles * skillMult; - this.unitCompleted += this.unitRate; + this.unitRate = CONSTANTS.MilliPerCycle * skillMult; + this.unitCompleted += this.unitRate * cycles; if (this.unitCompleted >= this.unitNeeded()) { return true; diff --git a/src/Work/GraftingWork.tsx b/src/Work/GraftingWork.tsx index ddf910a47..b9811e18b 100644 --- a/src/Work/GraftingWork.tsx +++ b/src/Work/GraftingWork.tsx @@ -49,8 +49,8 @@ export class GraftingWork extends Work { process(cycles: number): boolean { const focusBonus = Player.focusPenalty(); this.cyclesWorked += cycles; - this.unitRate = CONSTANTS.MilliPerCycle * cycles * graftingIntBonus() * focusBonus; - this.unitCompleted += this.unitRate; + this.unitRate = CONSTANTS.MilliPerCycle * graftingIntBonus() * focusBonus; + this.unitCompleted += this.unitRate * cycles; return this.unitCompleted >= this.unitNeeded(); }