FindSuppressor Improvements

Fixed classname for 7.62 suppressor

Using fancy shmancy switch-do now
This commit is contained in:
eraser1 2015-09-04 11:12:56 -05:00
parent f0d25fb718
commit 6e627cf355

View File

@ -13,15 +13,12 @@ private["_weapon","_result","_weaponName","_rnd338","_rnd93"];
_result = "";
_weapon = _this;
// Zafir accepts no suppressors :(
if ((_weapon find "Zafir")>-1) exitWith {""};
_weaponName = getText (configFile >> "cfgWeapons" >> _weapon >> "displayName");
call
switch (true) do
{
if ((_weaponName find "6.5") > -1) exitWith
case ((_weaponName find "6.5") > -1) :
{
if (_weapon find "LMG_Mk200" > -1) then
{
@ -31,20 +28,23 @@ call
{
_result = "muzzle_snds_H";
};
};
};
if ((_weaponName find "5.56") > -1) exitWith {_result = "muzzle_snds_M";};
case ((_weaponName find "5.56") > -1) : {_result = "muzzle_snds_M";};
if ((_weaponName find "7.62") > -1) exitWith {_result = "muzzle_snds_H";};
case ((_weaponName find "7.62") > -1) : {_result = "muzzle_snds_B";};
if ((_weaponName find ".45") > -1) exitWith {_result = "muzzle_snds_acp";};
case ((_weaponName find ".45") > -1) : {_result = "muzzle_snds_acp";};
if ((_weaponName find "9 mm") > -1) exitWith {_result = "muzzle_snds_L";};
case ((_weaponName find "9 mm") > -1) : {_result = "muzzle_snds_L";};
if ((_weaponName find ".338") > -1) exitWith {_result = ["muzzle_snds_338_black","muzzle_snds_338_green","muzzle_snds_338_sand"] call BIS_fnc_selectRandom;};
case ((_weaponName find ".338") > -1) : {_result = ["muzzle_snds_338_black","muzzle_snds_338_green","muzzle_snds_338_sand"] call BIS_fnc_selectRandom;};
if ((_weaponName find "9.3 mm") > -1) exitWith {_result = ["muzzle_snds_93mmg","muzzle_snds_93mmg_tan"] call BIS_fnc_selectRandom;};
case ((_weaponName find "9.3 mm") > -1) : {_result = ["muzzle_snds_93mmg","muzzle_snds_93mmg_tan"] call BIS_fnc_selectRandom;};
};
// Zafir accepts no suppressors :(
if ((_weapon find "Zafir")>-1) then {_result = "";};
_result