Resolves Bot Generation Error
- Resolves an issue in bot generation caused by a missing parameter when calling the `shouldModBeSpawned` method. - Adds a optional chaining operator within a condition to safeguard against undefined errors. Contributed by: barlog_m Thank you! :D
This commit is contained in:
parent
cd6e40b66c
commit
807ba04967
@ -108,6 +108,7 @@ export class BotEquipmentModGenerator
|
|||||||
itemSlotTemplate,
|
itemSlotTemplate,
|
||||||
modSlotName.toLowerCase(),
|
modSlotName.toLowerCase(),
|
||||||
settings.spawnChances.equipmentMods,
|
settings.spawnChances.equipmentMods,
|
||||||
|
settings.botEquipmentConfig,
|
||||||
);
|
);
|
||||||
if (modSpawnResult === ModSpawn.SKIP && !forceSpawn)
|
if (modSpawnResult === ModSpawn.SKIP && !forceSpawn)
|
||||||
{
|
{
|
||||||
@ -725,7 +726,7 @@ export class BotEquipmentModGenerator
|
|||||||
return ModSpawn.SPAWN;
|
return ModSpawn.SPAWN;
|
||||||
}
|
}
|
||||||
const spawnMod = this.probabilityHelper.rollChance(modSpawnChances[modSlot]);
|
const spawnMod = this.probabilityHelper.rollChance(modSpawnChances[modSlot]);
|
||||||
if (!spawnMod && (slotRequired || botEquipConfig.weaponSlotIdsToMakeRequired.includes(modSlot)))
|
if (!spawnMod && (slotRequired || botEquipConfig.weaponSlotIdsToMakeRequired?.includes(modSlot)))
|
||||||
{
|
{
|
||||||
// Mod is required but spawn chance roll failed, choose default mod spawn for slot
|
// Mod is required but spawn chance roll failed, choose default mod spawn for slot
|
||||||
return ModSpawn.DEFAULT_MOD;
|
return ModSpawn.DEFAULT_MOD;
|
||||||
|
Loading…
Reference in New Issue
Block a user