From 4b9f2ddbd16144fd5ffaeaf7429f3e84c30c715f Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 9 Feb 2024 22:01:19 +0000 Subject: [PATCH] Fixed 2 issues with collecting bitcoins; Only check if progress was only `great than` craft time, not `great than or equal to` Didn't take into account developer accounts have reduce craft timers --- project/src/helpers/HideoutHelper.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/project/src/helpers/HideoutHelper.ts b/project/src/helpers/HideoutHelper.ts index 18b51e5a..356dd15d 100644 --- a/project/src/helpers/HideoutHelper.ts +++ b/project/src/helpers/HideoutHelper.ts @@ -753,8 +753,8 @@ export class HideoutHelper protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production { const btcProd = pmcData.Hideout.Production[HideoutHelper.bitcoinFarm]; - const bitcoinProdData = this.databaseServer.getTables().hideout.production.find((p) => - p._id === HideoutHelper.bitcoinProductionId + const bitcoinProdData = this.databaseServer.getTables().hideout.production.find((production) => + production._id === HideoutHelper.bitcoinProductionId ); const coinSlotCount = this.getBTCSlots(pmcData); @@ -807,9 +807,11 @@ export class HideoutHelper } */ // BSG finally fixed their settings, they now get loaded from the settings and used in the client - const coinCraftTimeSeconds = bitcoinProdData.productionTime + const coinCraftTimeSeconds = + ((this.profileHelper.isDeveloperAccount(pmcData.sessionId)) ? 40 : bitcoinProdData.productionTime) / (1 + (btcFarmCGs - 1) * this.databaseServer.getTables().hideout.settings.gpuBoostRate); - while (btcProd.Progress > coinCraftTimeSeconds) + + while (btcProd.Progress >= coinCraftTimeSeconds) { if (btcProd.Products.length < coinSlotCount) { @@ -818,6 +820,7 @@ export class HideoutHelper } else { + // Filled up bitcoin storage btcProd.Progress = 0; } } @@ -843,6 +846,7 @@ export class HideoutHelper upd: { StackObjectsCount: 1 }, }); + // Deduct time spent crafting from progress btcProd.Progress -= coinCraftTimeSeconds; } @@ -863,7 +867,8 @@ export class HideoutHelper let timeElapsed = this.timeUtil.getTimestamp() - pmcData.Hideout.sptUpdateLastRunTimestamp; if (recipe?.areaType === HideoutAreas.LAVATORY) - { // Lavatory works at 100% when power is on / off + { + // Lavatory works at 100% when power is on / off return timeElapsed; }