diff --git a/project/src/helpers/HideoutHelper.ts b/project/src/helpers/HideoutHelper.ts index 8cea5c93..d24e50c0 100644 --- a/project/src/helpers/HideoutHelper.ts +++ b/project/src/helpers/HideoutHelper.ts @@ -289,12 +289,12 @@ export class HideoutHelper return; } - // Get seconds since production started + now - let timeElapsed = (this.timeUtil.getTimestamp() - pmcData.Hideout.Production[prodId].StartTimestamp) - pmcData.Hideout.Production[prodId].Progress; + // Get seconds since last hideout update + now + let timeElapsed = this.timeUtil.getTimestamp() - pmcData.Hideout.sptUpdateLastRunTimestamp; if (!hideoutProperties.isGeneratorOn) { // Adjust for running without fuel - timeElapsed = Math.floor(timeElapsed * this.databaseServer.getTables().hideout.settings.generatorSpeedWithoutFuel); + timeElapsed *= this.databaseServer.getTables().hideout.settings.generatorSpeedWithoutFuel; } // Increment progress by time passed diff --git a/project/src/routers/EventOutputHolder.ts b/project/src/routers/EventOutputHolder.ts index 5bd3ec1c..620c8f83 100644 --- a/project/src/routers/EventOutputHolder.ts +++ b/project/src/routers/EventOutputHolder.ts @@ -146,6 +146,12 @@ export class EventOutputHolder { this.clientActiveSessionStorage[productionKey] = {clientInformed: true}; } + + // Only return integer for progress, ignore the decimal progress gained when generator is off + if (production.Progress > 0) + { + Math.round(production.Progress); + } } return productions;