Update updateProductionTimers() to handle Progress value being undefined

This commit is contained in:
Dev 2023-11-10 19:18:58 +00:00
parent 37029791da
commit d2f4327871

View File

@ -233,6 +233,12 @@ export class HideoutHelper
delete pmcData.Hideout.Production[prodId];
}
if (craft.Progress === undefined)
{
this.logger.warning(`Craft ${prodId} has an undefined progress value, defaulting to 0`);
craft.Progress = 0;
}
// Craft complete, skip processing (Don't skip continious crafts like bitcoin farm)
if (craft.Progress >= craft.ProductionTime && prodId !== HideoutHelper.bitcoinFarm)
{