diff --git a/cScripts/functions/gear/fn_gear_applyCosmetics.sqf b/cScripts/functions/gear/fn_gear_applyCosmetics.sqf index 7a59624f3..0e08201f7 100644 --- a/cScripts/functions/gear/fn_gear_applyCosmetics.sqf +++ b/cScripts/functions/gear/fn_gear_applyCosmetics.sqf @@ -4,41 +4,35 @@ * This function apply cosmetician attributes to a unit. * * Arguments: - * 0: Unit + * None * * Return Value: * Nothing * * Example: - * [player] call cScripts_fnc_gear_applyCosmetics + * call cScripts_fnc_gear_applyCosmetics * */ -params [["_unit", objNull, [objNull]]]; - - // Player Name without rank prefix -if (!isNil{GETVAR(_unit,EGVAR(Unit,Name),nil)}) then { - private _name = [_unit] call EFUNC(unit,getName); - SETVAR(_unit,EGVAR(Unit,Name),_name); +if (!isNil{GETVAR(player,EGVAR(Unit,Name),nil)}) then { + private _name = [player] call EFUNC(unit,getName); + SETVAR(player,EGVAR(Unit,Name),_name); }; - // Player Rank to ingame rank if (EGVAR(Settings,setPlayerRank)) then { - if (!isNil{GETVAR(_unit,EGVAR(Unit,Rank),nil)}) then { - private _rank = [_unit] call EFUNC(player,getRank); - SETVAR(_unit,EGVAR(Unit,Rank),_rank); + if (!isNil{GETVAR(player,EGVAR(Unit,Rank),nil)}) then { + private _rank = [player] call EFUNC(player,getRank); + SETVAR(player,EGVAR(Unit,Rank),_rank); }; }; - // Team Color -if (!isNil{GETVAR(_unit,EGVAR(Unit,TeamColor),nil)}) then { - [_unit] call EFUNC(unit,setTeamColor); +if (!isNil{GETVAR(player,EGVAR(Unit,TeamColor),nil)}) then { + [player] call EFUNC(unit,setTeamColor); }; - // Apply squad insignia if (EGVAR(Settings,allowInsigniaApplication)) then { private _insignia = if (call EFUNC(profile,loadInsignia) != "") then { @@ -47,7 +41,7 @@ if (EGVAR(Settings,allowInsigniaApplication)) then { call EFUNC(unit,getSquadInsignia); }; [{ - params ["_unit", "_insignia"]; - [_unit, _insignia, false] call EFUNC(unit,setInsignia); - }, [_unit, _insignia], 2] call CBA_fnc_waitAndExecute; + params ["_insignia"]; + [player, _insignia, false] call EFUNC(unit,setInsignia); + }, [_insignia], 2] call CBA_fnc_waitAndExecute; }; \ No newline at end of file diff --git a/cScripts/functions/gear/fn_gear_applyLoadout.sqf b/cScripts/functions/gear/fn_gear_applyLoadout.sqf index 7636f6d0b..5e230500d 100644 --- a/cScripts/functions/gear/fn_gear_applyLoadout.sqf +++ b/cScripts/functions/gear/fn_gear_applyLoadout.sqf @@ -37,7 +37,7 @@ if (_loadConfig) then { _unit setVariable [QEGVAR(Gear,LoadoutClass), _loadout]; // Organizaiton - if (GVAR(isPlayer)) then { + if (hasInterface) then { private _configPlatoon = getNumber (_config >> "platoon"); private _configCompany = getText (_config >> "company"); [_configPlatoon,_configCompany] call EFUNC(Player,setOrganization); @@ -77,20 +77,15 @@ if (!_loadArray) then { }; // Functions -if (GVAR(isPlayer)) then { +if (hasInterface) then { call EFUNC(gear,applyFunctions); -}; - -// Select weapon -_unit selectWeapon (primaryWeapon _unit); + call EFUNC(gear,applyCosmetics); -// Apply googles effect after loadout applications -[_unit, goggles _unit] call ace_goggles_fnc_applyGlassesEffect; + [_unit, goggles _unit] call ace_goggles_fnc_applyGlassesEffect; -// Lower the weapon -if !(weaponLowered _unit) then {_unit action ["WeaponOnBack", _unit]}; + _unit selectWeapon (primaryWeapon _unit); + if !(weaponLowered _unit) then {_unit action ["WeaponOnBack", _unit]}; -if (GVAR(isPlayer)) then { [QEGVAR(StagingArsenal,SaveWhitelist)] call CBA_fnc_localEvent; }; diff --git a/cScripts/functions/gear/fn_gear_getLoadoutName.sqf b/cScripts/functions/gear/fn_gear_getLoadoutName.sqf index f41f82191..53b55a677 100644 --- a/cScripts/functions/gear/fn_gear_getLoadoutName.sqf +++ b/cScripts/functions/gear/fn_gear_getLoadoutName.sqf @@ -17,7 +17,6 @@ params [["_unit", objNull, [objNull]]]; - private _return = GETVAR(_unit,EGVAR(Gear,loadoutClass), typeOf _unit); _return \ No newline at end of file diff --git a/cScripts/functions/gear/fn_gear_getSideConfig.sqf b/cScripts/functions/gear/fn_gear_getSideConfig.sqf index b2992e12e..f2a460c6e 100644 --- a/cScripts/functions/gear/fn_gear_getSideConfig.sqf +++ b/cScripts/functions/gear/fn_gear_getSideConfig.sqf @@ -14,6 +14,7 @@ * [independent] call cScripts_fnc_gear_getSideConfig * */ + params ["_side"]; switch (_side) do { diff --git a/cScripts/functions/gear/fn_gear_preInit.sqf b/cScripts/functions/gear/fn_gear_preInit.sqf index 39ac65243..aa8ebdb66 100644 --- a/cScripts/functions/gear/fn_gear_preInit.sqf +++ b/cScripts/functions/gear/fn_gear_preInit.sqf @@ -10,7 +10,7 @@ * nothing * * Example: - * call cScripts_fnc_gear_postInit + * call cScripts_fnc_gear_preInit * */