Fix plate filtering code not correctly handling when no plates of desired armor level are found
This commit is contained in:
parent
4078d7cc89
commit
f59041121b
@ -212,11 +212,12 @@ export class BotEquipmentModGenerator
|
||||
|
||||
// Filter plates to the chosen level based on its armorClass property
|
||||
const filteredPlates = platesFromDb.filter(x => x._props.armorClass === chosenArmorPlateLevel);
|
||||
if (!filteredPlates)
|
||||
if (filteredPlates.length === 0)
|
||||
{
|
||||
this.logger.warning(`Plate filter was too restrictive, unable to find plates of level: ${chosenArmorPlateLevel}. Returning all ${modPool.length} plates instead`);
|
||||
this.logger.warning(`Plate filter was too restrictive, unable to find plates of level: ${chosenArmorPlateLevel}. Using mods default`);
|
||||
|
||||
return modPool;
|
||||
const relatedItemDbModSlot = armorItem._props.Slots.find(slot => slot._name.toLowerCase() === modSlot);
|
||||
return [relatedItemDbModSlot._props.filters[0].Plate];
|
||||
}
|
||||
|
||||
// Only return the items ids
|
||||
|
Loading…
Reference in New Issue
Block a user