Skip to content

Commit

Permalink
Fixed cosmetic functions not pressent
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBrostrom committed Apr 18, 2024
1 parent a483178 commit e5cb370
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
32 changes: 13 additions & 19 deletions cScripts/functions/gear/fn_gear_applyCosmetics.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,35 @@
* This function apply cosmetician attributes to a unit.
*
* Arguments:
* 0: Unit <OBJECT>
* 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 {
Expand All @@ -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;
};
1 change: 1 addition & 0 deletions cScripts/functions/gear/fn_gear_applyLoadout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ if (!_loadArray) then {
// Functions
if (hasInterface) then {
call EFUNC(gear,applyFunctions);
call EFUNC(gear,applyCosmetics);

[_unit, goggles _unit] call ace_goggles_fnc_applyGlassesEffect;

Expand Down

0 comments on commit e5cb370

Please sign in to comment.