Fixed scav case never giving unarmored rigs as a reward

This commit is contained in:
Dev 2024-03-23 11:23:29 +00:00
parent 7b557a31ad
commit cdec8729aa
2 changed files with 16 additions and 1 deletions

View File

@ -314,7 +314,7 @@ export class ScavCaseRewardGenerator
}
// Armor or weapon = use default preset from globals.json
else if (
this.itemHelper.armorItemCanHoldMods(rewardItemDb._id)
this.itemHelper.armorItemHasRemovableOrSoftInsertSlots(rewardItemDb._id)
|| this.itemHelper.isOfBaseclass(rewardItemDb._id, BaseClasses.WEAPON)
)
{

View File

@ -106,6 +106,21 @@ export class ItemHelper
return this.isOfBaseclasses(itemTpl, [BaseClasses.HEADWEAR, BaseClasses.VEST, BaseClasses.ARMOR]);
}
/**
* Does the provided item tpl need soft/removable inserts to function
* @param itemTpl Armor item
* @returns True if item needs some kind of insert
*/
public armorItemHasRemovableOrSoftInsertSlots(itemTpl: string): boolean
{
if (!this.armorItemCanHoldMods(itemTpl))
{
return false;
}
return (this.armorItemHasRemovablePlateSlots(itemTpl) || this.itemRequiresSoftInserts(itemTpl));
}
/**
* Does the pased in tpl have ability to hold removable plate items
* @param itemTpl item tpl to check for plate support