From f1bea80c346cf2778c655ac01d2dbc4e2a6bb05c Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Fri, 12 Apr 2024 13:24:19 +0200 Subject: [PATCH] Fixed issue were arsenal whitelist were not created on first load to server --- cScripts/functions/gear/fn_gear_postInit.sqf | 15 --------------- cScripts/functions/gear/fn_gear_preInit.sqf | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cScripts/functions/gear/fn_gear_postInit.sqf b/cScripts/functions/gear/fn_gear_postInit.sqf index b06bcc065..4cbc951c4 100644 --- a/cScripts/functions/gear/fn_gear_postInit.sqf +++ b/cScripts/functions/gear/fn_gear_postInit.sqf @@ -22,19 +22,4 @@ if (isServer) then { } else { SHOW_CHAT_WARNING("Gear_PostInit", "Mission in singelplayer environment radio setup will not be performed"); }; -}; - -if (hasInterface) then { - ["ace_arsenal_displayClosed", { - player call EFUNC(gear,saveLoadout); - }] call CBA_fnc_addEventHandler; - - [QEGVAR(gear,applyLoadout), { - _this params [ - ["_unit", objNull, [objNull]], - ["_loadout", "", [""]] - ]; - _loadout = if (_loadout == "") then {[_unit] call EFUNC(gear,selectLoadout)} else {_loadout}; - [_unit, _loadout] call EFUNC(gear,applyLoadout); - }] call CBA_fnc_addEventHandler; }; \ No newline at end of file diff --git a/cScripts/functions/gear/fn_gear_preInit.sqf b/cScripts/functions/gear/fn_gear_preInit.sqf index 39ac65243..acbbcd04e 100644 --- a/cScripts/functions/gear/fn_gear_preInit.sqf +++ b/cScripts/functions/gear/fn_gear_preInit.sqf @@ -19,6 +19,21 @@ GVAR(Gear) = false; EGVAR(gear,groupIDsSynched) = false; EGVAR(gear,playerLoadoutGiven) = false; +if (hasInterface) then { + ["ace_arsenal_displayClosed", { + player call EFUNC(gear,saveLoadout); + }] call CBA_fnc_addEventHandler; + + [QEGVAR(gear,applyLoadout), { + _this params [ + ["_unit", objNull, [objNull]], + ["_loadout", "", [""]] + ]; + _loadout = if (_loadout == "") then {[_unit] call EFUNC(gear,selectLoadout)} else {_loadout}; + [_unit, _loadout] call EFUNC(gear,applyLoadout); + }] call CBA_fnc_addEventHandler; +}; + if (isClass (missionConfigFile >> "CfgLoadouts")) then { ["CAManBase", "InitPost", { params ["_unit"];