65 lines
1.9 KiB
Plaintext
65 lines
1.9 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
params ["_unit", "_bodyBag"];
|
|
|
|
private _items = [];
|
|
private _weapons = [];
|
|
private _backpack = backpack _unit;
|
|
private _nearHolders = _bodyBag nearObjects ["WeaponHolderSimulated", 3];
|
|
|
|
_items pushBack (headgear _unit);
|
|
_items pushBack (uniform _unit);
|
|
_items append (uniformItems _unit);
|
|
_items pushBack (vest _unit);
|
|
_items append (vestItems _unit);
|
|
_items append (backpackItems _unit);
|
|
_weapons pushBack (primaryWeapon _unit);
|
|
_items append (primaryWeaponItems _unit);
|
|
_items append (primaryWeaponMagazine _unit);
|
|
_weapons pushBack (secondaryWeapon _unit);
|
|
_items append (secondaryWeaponItems _unit);
|
|
_items append (secondaryWeaponMagazine _unit);
|
|
_weapons pushBack (handgunWeapon _unit);
|
|
_items append (handgunItems _unit);
|
|
_items append (handgunMagazine _unit);
|
|
_weapons append (_unit getVariable [QGVAR(droppedWeapons), []]);
|
|
_items append (_unit getVariable [QGVAR(droppedItems), []]);
|
|
_items append (assignedItems _unit);
|
|
_items pushBack (_unit call CFUNC(binocularMagazine));
|
|
|
|
if !((goggles _unit ) in (_unit getVariable [QGVAR(droppedItems), []])) then {
|
|
_items pushBack (goggles _unit);
|
|
};
|
|
|
|
_items = _items select {_x != ""};
|
|
_weapons = _weapons select {_x != ""};
|
|
|
|
{ _bodyBag addItemCargoGlobal [_x, 1] } forEach _items;
|
|
|
|
{
|
|
private _weaponNonPresent = [_x] call CFUNC(getNonPresetClass);
|
|
|
|
if (_weaponNonPresent == "") then {
|
|
_weaponNonPresent = _x;
|
|
};
|
|
|
|
_bodyBag addWeaponCargoGlobal [_weaponNonPresent, 1];
|
|
} forEach _weapons;
|
|
|
|
if (_backpack != "") then {
|
|
private _backpackNonPresent = [_backpack, "CfgVehicles"] call CFUNC(getNonPresetClass);
|
|
|
|
if (_backpackNonPresent == "") then {
|
|
_backpackNonPresent = _backpack;
|
|
};
|
|
|
|
_bodyBag addBackpackCargoGlobal [_backpackNonPresent, 1];
|
|
};
|
|
|
|
{
|
|
private _holderWeapons = ((getWeaponCargo _x) select 0) select { _x in _weapons };
|
|
|
|
if !(_holderWeapons isEqualTo []) then {
|
|
deleteVehicle _x;
|
|
};
|
|
} forEach _nearHolders; |