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