diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf index 133eaec28d..425d89828e 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsLoad.sqf @@ -9,8 +9,22 @@ private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; private _curSel = lnbCurSelRow _contentPanelCtrl; private _loadoutName = _contentPanelCtrl lnbText [_curSel, 1]; -private _loadout = (GVAR(sharedLoadoutsNamespace) getVariable ((_contentPanelCtrl lnbText [_curSel, 0]) + (_contentPanelCtrl lnbText [_curSel, 1]))) select 2; -GVAR(center) setUnitLoadout [[_contentPanelCtrl getVariable _loadoutName + QGVAR(currentLoadoutsTab), _loadout] select (GVAR(currentLoadoutsTab) == IDC_buttonSharedLoadouts), true]; +private _loadout = switch GVAR(currentLoadoutsTab) do { + + case IDC_buttonMyLoadouts; + case IDC_buttonDefaultLoadouts:{ + _contentPanelCtrl getVariable _loadoutName + QGVAR(currentLoadoutsTab) + }; + + case IDC_buttonSharedLoadouts:{ + (GVAR(sharedLoadoutsNamespace) getVariable ((_contentPanelCtrl lnbText [_curSel, 0]) + (_contentPanelCtrl lnbText [_curSel, 1]))) select 2 + }; +}; + +TRACE_1("loadout load", _loadout); + + +GVAR(center) setUnitLoadout [_loadout, true]; GVAR(currentItems) = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", [], [], [], [], [], []]; for "_index" from 0 to 15 do { diff --git a/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf b/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf index e8002abe3a..6079f2d41f 100644 --- a/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf +++ b/addons/arsenal/functions/fnc_buttonLoadoutsShare.sqf @@ -12,7 +12,7 @@ private _profileName = profileName; // GVAR(center) could be a remote unit private _loadoutVar = _profileName + _loadoutName; private _loadoutIndex = GVAR(sharedLoadoutsVars) find _loadoutVar; -private _loadoutData = _contentPanelCtrl getVariable _loadoutName; +private _loadoutData = _contentPanelCtrl getVariable (_loadoutName + QGVAR(currentLoadoutsTab)); if (_loadoutIndex > -1) then { GVAR(sharedLoadoutsNamespace) setVariable [_loadoutVar, nil, true]; diff --git a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf index 6a3ca9202f..4b0bb6f30f 100644 --- a/addons/arsenal/functions/fnc_fillLoadoutsList.sqf +++ b/addons/arsenal/functions/fnc_fillLoadoutsList.sqf @@ -75,7 +75,7 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then { { _x params ["_playerName", "_loadoutName", "_loadoutData"]; - if !((allPlayers apply {name _x}) find _playerName > -1) then { + if ((allPlayers apply {name _x}) find _playerName == -1) then { private _loadoutVar = _playerName + _loadoutName; GVAR(sharedLoadoutsNamespace) setVariable [_loadoutVar, nil, true]; diff --git a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf index 600c8a8401..2990d42633 100644 --- a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf +++ b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf @@ -15,7 +15,7 @@ * [LOGIC, nil, true] call ace_zeus_fnc_bi_moduleArsenal * * Public: No - */ +*/ #include "script_component.hpp"