Begin work on updating equpiment code to handle required mods
This commit is contained in:
parent
a8a0185257
commit
369a8a6cca
@ -4654,6 +4654,12 @@
|
||||
]
|
||||
},
|
||||
"mods": {
|
||||
"5648a7494bdc2d9d488b4583": {
|
||||
"soft_armor_front": ["65703d866584602f7d057a8a"],
|
||||
"soft_armor_back": ["65703fa06584602f7d057a8e"],
|
||||
"soft_armor_left": ["65703fe46a912c8b5c03468b"],
|
||||
"soft_armor_right": ["657040374e67e8ec7a0d261c"]
|
||||
},
|
||||
"5447a9cd4bdc2dbd208b4567": {
|
||||
"mod_charge": [
|
||||
"6033749e88382f4fab3fd2c5",
|
||||
|
@ -97,7 +97,10 @@ export class BotEquipmentModGenerator
|
||||
}
|
||||
|
||||
// Ensure submods for nvgs all spawn together
|
||||
forceSpawn = (modSlot === "mod_nvg") ? true : false;
|
||||
if (modSlot === "mod_nvg")
|
||||
{
|
||||
forceSpawn = true;
|
||||
}
|
||||
|
||||
let modTpl: string;
|
||||
let found = false;
|
||||
@ -542,16 +545,17 @@ export class BotEquipmentModGenerator
|
||||
*/
|
||||
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot
|
||||
{
|
||||
switch (modSlot)
|
||||
const modSlotLower = modSlot.toLowerCase();
|
||||
switch (modSlotLower)
|
||||
{
|
||||
case "patron_in_weapon":
|
||||
case "patron_in_weapon_000":
|
||||
case "patron_in_weapon_001":
|
||||
return parentTemplate._props.Chambers.find((c) => c._name.includes(modSlot));
|
||||
return parentTemplate._props.Chambers.find((chamber) => chamber._name.includes(modSlotLower));
|
||||
case "cartridges":
|
||||
return parentTemplate._props.Cartridges.find((c) => c._name === modSlot);
|
||||
return parentTemplate._props.Cartridges.find((c) => c._name.toLowerCase() === modSlotLower);
|
||||
default:
|
||||
return parentTemplate._props.Slots.find((s) => s._name === modSlot);
|
||||
return parentTemplate._props.Slots.find((s) => s._name.toLowerCase() === modSlotLower);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user