Fix weapon mod generation choosing a default mod only to keep it flagged as incompatible
This commit is contained in:
parent
1995fbfef0
commit
58d620d424
@ -784,7 +784,7 @@ export class BotEquipmentModGenerator
|
||||
if (chosenModResult.incompatible && parentSlot._required)
|
||||
{
|
||||
this.logger.debug(chosenModResult.reason);
|
||||
this.logger.debug(`Weapon: ${weapon.map(x => `${x._tpl} ${x.slotId ?? ""}`).join(",")}`)
|
||||
//this.logger.debug(`Weapon: ${weapon.map(x => `${x._tpl} ${x.slotId ?? ""}`).join(",")}`)
|
||||
}
|
||||
|
||||
// Get random mod to attach from items db for required slots if none found above
|
||||
@ -840,6 +840,7 @@ export class BotEquipmentModGenerator
|
||||
{
|
||||
// Default mod wanted and only one choice in pool
|
||||
chosenModResult.found = true;
|
||||
chosenModResult.incompatible = false;
|
||||
chosenModResult.chosenTpl = chosenTpl;
|
||||
|
||||
break;
|
||||
|
@ -372,9 +372,7 @@ export class BotWeaponGenerator
|
||||
continue;
|
||||
}
|
||||
|
||||
const allowedTplsOnSlot = modSlotTemplate._props.filters[0].Filter;
|
||||
const slotName = modSlotTemplate._name;
|
||||
|
||||
const weaponSlotItem = weaponItemArray.find((weaponItem) => weaponItem.parentId === mod._id && weaponItem.slotId === slotName);
|
||||
if (!weaponSlotItem)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user