Sort mod_barrel after mod_handguard to prevent weapon gen errors with certain combinations of barrel + gas blocks causing all handgaurds to be incompatible

Also force gas block to be processed AFTER barrel + handguard
This commit is contained in:
Dev 2023-10-29 16:35:03 +00:00
parent 1cd13ce21f
commit 8223124882

View File

@ -386,13 +386,20 @@ export class BotEquipmentModGenerator
const sortedKeys: string[] = []; const sortedKeys: string[] = [];
const modRecieverKey = "mod_reciever"; const modRecieverKey = "mod_reciever";
const modMount001Key = "mod_mount_001"; const modMount001Key = "mod_mount_001";
const modGasBLockKey = "mod_gas_block"; const modGasBlockKey = "mod_gas_block";
const modPistolGrip = "mod_pistol_grip"; const modPistolGrip = "mod_pistol_grip";
const modStockKey = "mod_stock"; const modStockKey = "mod_stock";
const modBarrelKey = "mod_barrel"; const modBarrelKey = "mod_barrel";
const modHandguardKey = "mod_handguard";
const modMountKey = "mod_mount"; const modMountKey = "mod_mount";
const modScopeKey = "mod_scope"; const modScopeKey = "mod_scope";
if (unsortedKeys.includes(modHandguardKey))
{
sortedKeys.push(modHandguardKey);
unsortedKeys.splice(unsortedKeys.indexOf(modHandguardKey), 1);
}
if (unsortedKeys.includes(modBarrelKey)) if (unsortedKeys.includes(modBarrelKey))
{ {
sortedKeys.push(modBarrelKey); sortedKeys.push(modBarrelKey);
@ -417,10 +424,10 @@ export class BotEquipmentModGenerator
unsortedKeys.splice(unsortedKeys.indexOf(modPistolGrip), 1); unsortedKeys.splice(unsortedKeys.indexOf(modPistolGrip), 1);
} }
if (unsortedKeys.includes(modGasBLockKey)) if (unsortedKeys.includes(modGasBlockKey))
{ {
sortedKeys.push(modGasBLockKey); sortedKeys.push(modGasBlockKey);
unsortedKeys.splice(unsortedKeys.indexOf(modGasBLockKey), 1); unsortedKeys.splice(unsortedKeys.indexOf(modGasBlockKey), 1);
} }
if (unsortedKeys.includes(modStockKey)) if (unsortedKeys.includes(modStockKey))