Skip to content

Commit 741a2ad

Browse files
Revert to vanilla loadout functions, re-apply ACEAX textures on switch (#21)
1 parent 80fce0f commit 741a2ad

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

addons/main/XEH_postInit.sqf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ if (isServer) then {
4343
}] call CBA_fnc_addEventHandler;
4444
};
4545

46+
GVAR(isACEAXLoaded) = isClass (configFile >> "CfgPatches" >> "aceax_gearinfo");
47+
4648
// Backpack classnames which will be made invisible instead of being made a chestpack. Useful for items like the vanilla legstrap.
4749
GVAR(exceptions) = [
4850
"B_LegStrapBag_black_F",

addons/main/functions/fnc_actionOnBack.sqf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ private _shouldSwitchNVGs = currentVisionMode _unit != 0;
2626
if ((_chestpack isEqualTo "") or (backpack _unit isNotEqualTo "")) exitWith {};
2727

2828
//add items
29-
private _loadout = [_unit] call CBA_fnc_getLoadout;
30-
(_loadout select 0) set [5, [_chestpack, _chestpackLoadout]];
31-
[_unit, _loadout] call CBA_fnc_setLoadout;
29+
private _loadout = getUnitLoadout _unit;
30+
_loadout set [5, [_chestpack, _chestpackLoadout]];
31+
_unit setUnitLoadout _loadout;
32+
33+
if (GVAR(isACEAXLoaded)) then {
34+
[_unit, [_unit] call aceax_gearinfo_fnc_getTextureOptions] call aceax_gearinfo_fnc_setTextureOptions;
35+
};
36+
3237
if (_shouldSwitchNVGs) then {
3338
_unit action ["NVGoggles", _unit];
3439
};

addons/main/functions/fnc_actionSwap.sqf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ if ((_backpack isEqualTo "") or ([_unit] call FUNC(chestpack)) isEqualTo "") exi
4141
removeBackpackGlobal _unit;
4242

4343
//add backpack loadout
44-
private _loadout = [_unit] call CBA_fnc_getLoadout;
45-
(_loadout select 0) set [5, [_chestpack, _chestpackLoadout]];
46-
[_unit, _loadout] call CBA_fnc_setLoadout;
44+
private _loadout = getUnitLoadout _unit;
45+
_loadout set [5, [_chestpack, _chestpackLoadout]];
46+
_unit setUnitLoadout _loadout;
47+
48+
if (GVAR(isACEAXLoaded)) then {
49+
[_unit, [_unit] call aceax_gearinfo_fnc_getTextureOptions] call aceax_gearinfo_fnc_setTextureOptions;
50+
};
51+
4752
if (_shouldSwitchNVGs) then {
4853
_unit action ["NVGoggles", _unit];
4954
};

0 commit comments

Comments
 (0)