ACE3/addons/arsenal/functions/fnc_getLoadout.sqf
BrettMayson 438a90b63d
Common - Add CBA extended loadout (#8923)
* extended loadouts - earplugs, gunbag, and arsenal identity

* arsenal - maintain default loadout size check

* restore comment

Co-authored-by: jonpas <jonpas33@gmail.com>

* fix forgotten example

Co-authored-by: jonpas <jonpas33@gmail.com>
2022-08-25 11:56:54 -05:00

38 lines
875 B
Plaintext

#include "script_component.hpp"
/*
* Author: Brett Mayson
* Get the extended loadout of a unit, including identity options if enabled
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* CBA Extended Loadout <ARRAY>
*
* Example:
* [_unit] call ace_arsenal_fnc_getLoadout
*
* Public: Yes
*/
params [["_unit", objNull, [objNull]]];
if (isNull _unit) exitWith {};
([_unit] call CBA_fnc_getLoadout) params ["_loadout", "_extendedInfo"];
if (GVAR(loadoutsSaveFace)) then {
_extendedInfo set [QGVAR(face), face _unit];
};
if (GVAR(loadoutsSaveVoice)) then {
_extendedInfo set [QGVAR(voice), speaker _unit];
};
if (GVAR(loadoutsSaveInsignia)) then {
private _insignia = _unit getVariable ["BIS_fnc_setUnitInsignia_class", ""];
if (_insignia != "") then {
_extendedInfo set [QGVAR(insignia), _insignia];
};
};
[_loadout, _extendedInfo]