Force handguards that take a sub-handguard to set handguard spawn chance to 100% - fixes split handguards appearing without the lower part

Only adds lower when weapon has no launcher attached

Adjust sub stock adding code to trigger when stock has a subslot that starts with `mod_stock`, this means `mod_stock_akms` and `mod_stock_000` will be included
This commit is contained in:
Dev 2023-10-26 20:31:05 +01:00
parent 170a185928
commit f4fce0612e
4 changed files with 18 additions and 1 deletions

View File

@ -13785,6 +13785,11 @@
"5a800961159bd4315e3a1657"
]
},
"637f57b78d137b27f70c496a": {
"mod_foregrip": [
"58c157c886f774032749fb06"
]
},
"6386300124a1dc425c00577a": {
"mod_stock": [
"5a0c59791526d8dba737bba7"

View File

@ -4068,6 +4068,9 @@
"5a800961159bd4315e3a1657"
]
},
"637f57b78d137b27f70c496a": {
"mod_foregrip": ["58c157c886f774032749fb06"]
},
"55d45f484bdc2d972f8b456d": {
"mod_foregrip": [
"5c1bc5af2e221602b412949b"

View File

@ -266,8 +266,16 @@ export class BotEquipmentModGenerator
modSpawnChances.mod_sight_rear = 100;
}
// Handguard mod can take a sub handguard mod + weapon has no UBGL (takes same slot)
// Force spawn chance to be 100% to ensure it gets added
if (modSlot === "mod_handguard" && modToAddTemplate._props.Slots.find(x => x._name === "mod_handguard") && !weapon.find(x => x.slotId === "mod_launcher"))
{
// Needed for handguards with lower
modSpawnChances.mod_handguard = 100;
}
// If stock mod can take a sub stock mod, force spawn chance to be 100% to ensure stock gets added
if (modSlot === "mod_stock" && modToAddTemplate._props.Slots.find(x => x._name === "mod_stock"))
if (modSlot === "mod_stock" && modToAddTemplate._props.Slots.find(x => x._name.includes("mod_stock")))
{
// Stock mod can take additional stocks, could be a locking device, force 100% chance
modSpawnChances.mod_stock = 100;

View File

@ -82,6 +82,7 @@ export interface ModsChances
mod_tactical_001: number
mod_tactical_002: number
mod_tactical_003: number
mod_handguard: number
}
export interface Difficulties