Skip to content

Commit

Permalink
feat(arsenal): Use API function for saving loadout
Browse files Browse the repository at this point in the history
Additionally fixes the issue with restocking
  • Loading branch information
WitchFreya committed Jan 26, 2025
1 parent ffb624d commit fadabd5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 48 deletions.
1 change: 0 additions & 1 deletion addons/arsenal/XEH_PREP.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ PREP(onClickMigrate);
PREP(onLoadoutsDisplayOpened);
PREP(onLoadoutsListFilled);
PREP(onSelChangedLoadouts);
PREP(saveLoadoutWithName);
4 changes: 2 additions & 2 deletions addons/arsenal/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
};
private _target = currentNamespace getVariable ["ace_arsenal_center", player];
private _isValidTarget = local _target && {_target isEqualTo player};
if (_isValidTarget) exitWith {
if !(_isValidTarget) exitWith {
TRACE_1("Invalid loadout save target",_target);
};
[GVAR(lastLoadoutName), player call CBA_fnc_getLoadout] call FUNC(saveLoadoutWithName);
[GVAR(lastLoadoutName), player call CBA_fnc_getLoadout, true] call ace_arsenal_fnc_saveLoadout;
}] call CBA_fnc_addEventHandler;
4 changes: 2 additions & 2 deletions addons/arsenal/functions/fnc_confirmMigrate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ private _fnc_migrate = {
};

// backup the original
[format ["%1 (Backup)", _loadoutName], _extendedLoadout] call FUNC(saveLoadoutWithName);
[format ["%1 (Backup)", _loadoutName], _extendedLoadout, true] call ace_arsenal_fnc_saveLoadout;

// save the new
private _mut_newLoadout = [_loadout] call _fnc_migrate;
[_loadoutName, [_mut_newLoadout, _cbaExtended]] call FUNC(saveLoadoutWithName);
[_loadoutName, [_mut_newLoadout, _cbaExtended], true] call ace_arsenal_fnc_saveLoadout;

// remove the cached data
private _contentPanelCtrl = _display displayCtrl IDC_contentPanel;
Expand Down
43 changes: 0 additions & 43 deletions addons/arsenal/functions/fnc_saveLoadoutWithName.sqf

This file was deleted.

0 comments on commit fadabd5

Please sign in to comment.