Show error when missing caliber data in drawAmmoTpl()

This commit is contained in:
Dev 2024-01-02 15:01:27 +00:00
parent 45c6d4dfe7
commit 628d817348

View File

@ -1105,7 +1105,13 @@ export class ItemHelper
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string
{
const ammoArray = new ProbabilityObjectArray<string>(this.mathUtil, this.jsonUtil);
for (const icd of staticAmmoDist[caliber])
const ammos = staticAmmoDist[caliber];
if (!ammos)
{
this.logger.error(`missing caliber data for: ${caliber}`);
}
for (const icd of ammos)
{
ammoArray.push(new ProbabilityObject(icd.tpl, icd.relativeProbability));
}