0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

Added nullguard to getTimeElapsedSinceLastServerTick()

This commit is contained in:
Dev 2024-06-17 16:43:12 +01:00
parent 383ccf09d7
commit 996e567959

View File

@ -1003,12 +1003,15 @@ export class HideoutHelper
// Reduce time elapsed (and progress) when generator is off // Reduce time elapsed (and progress) when generator is off
let timeElapsed = this.timeUtil.getTimestamp() - pmcData.Hideout.sptUpdateLastRunTimestamp; let timeElapsed = this.timeUtil.getTimestamp() - pmcData.Hideout.sptUpdateLastRunTimestamp;
if (recipe)
{
const hideoutArea = this.databaseService.getHideout().areas.find((area) => area.type === recipe.areaType); const hideoutArea = this.databaseService.getHideout().areas.find((area) => area.type === recipe.areaType);
if (!hideoutArea.needsFuel) if (!hideoutArea.needsFuel)
{ {
// e.g. Lavatory works at 100% when power is on / off // e.g. Lavatory works at 100% when power is on / off
return timeElapsed; return timeElapsed;
} }
}
if (!isGeneratorOn) if (!isGeneratorOn)
{ {