diff --git a/cScripts/functions/gear/fn_gear_applyLoadout.sqf b/cScripts/functions/gear/fn_gear_applyLoadout.sqf index 6b9b0d903..7636f6d0b 100644 --- a/cScripts/functions/gear/fn_gear_applyLoadout.sqf +++ b/cScripts/functions/gear/fn_gear_applyLoadout.sqf @@ -91,11 +91,7 @@ _unit selectWeapon (primaryWeapon _unit); if !(weaponLowered _unit) then {_unit action ["WeaponOnBack", _unit]}; if (GVAR(isPlayer)) then { - [{!isNull player && player == player}, { - [QEGVAR(StagingArsenal,SaveWhitelist)] call CBA_fnc_localEvent; - }, [], 5, { - SHOW_SERVER_ERROR_2("Arsenal", "Whitelist creation have failed for %1 [%2]",name player,typeOf player); - }] call CBA_fnc_waitUntilAndExecute; + [QEGVAR(StagingArsenal,SaveWhitelist)] call CBA_fnc_localEvent; }; if (_loadConfig) then { diff --git a/cScripts/functions/systems/fn_getArsenalWhitelist.sqf b/cScripts/functions/systems/fn_getArsenalWhitelist.sqf index 906164d11..bd6d1dff0 100644 --- a/cScripts/functions/systems/fn_getArsenalWhitelist.sqf +++ b/cScripts/functions/systems/fn_getArsenalWhitelist.sqf @@ -1,3 +1,4 @@ +#define DEBUG_MODE #include "..\script_component.hpp"; /* * Author: CPL.Brostrom.A @@ -13,6 +14,8 @@ * call cScripts_fnc_getArsenalWhitelist; */ +waitUntil {!isNull player && player == player}; + private _classname = [player] call EFUNC(gear,getLoadoutName); if !(isClass (missionConfigFile >> "CfgLoadouts" >> _classname)) exitWith { SHOW_CHAT_WARNING_1("ArsenalWhitelist", "Loadout '%1' does not exist inside of mission config. No whitelist will be created.", _classname); @@ -118,4 +121,6 @@ private _launcherSpecific = switch (true) do { private _whitelist = _commonGear + _unitItems + _orgItems + _roleSpecific + _primarySpecific + _handgunSpecific + _launcherSpecific; +INFO_2("Arsenal", "Whitelist created for %1 [%2].",player,typeof player); + _whitelist