diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeLaunchers.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeLaunchers.sqf index a652cc1..7c17480 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeLaunchers.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeLaunchers.sqf @@ -11,21 +11,22 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private["_launcher","_launcherRounds"]; params["_unit"]; // = _this select 0; -_launcher = _unit getVariable ["Launcher",""]; -_unit removeWeapon _Launcher; -if (_launcher != "") then +private _loadout = _unit getVariable["launcher",[[],[]]]; + { - _unit removeWeapon _Launcher; - { - if (_launcher in weaponCargo _x) exitWith { - deleteVehicle _x; - }; - } forEach ((getPosATL _unit) nearObjects ["WeaponHolderSimulated",10]); - _launcherRounds = getArray (configFile >> "CfgWeapons" >> _Launcher >> "magazines"); //0; - { - if(_x in _launcherRounds) then {_unit removeMagazine _x;}; - } count magazines _unit; + unit removeMagazineGlobal _x; +} forEach (_loadout select 1); + +private _launcher = _loadout select 0; +if !(_launcher isEqualTo []) then +{ + if (_launcher in (weapons _unit)) then { + _unit removeWeapon _launcher; + } else { + { + if (_launcher in (weaponCargo _x)) exitWith {deleteVehicle _x}; + } forEach (_unit nearObjects ["WeaponHolderSimulated",10]); + }; };