Skip to content

Commit 6080190

Browse files
committed
Add backpack hiding for certain backpacks
1 parent da7a154 commit 6080190

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

addons/main/XEH_postInit.sqf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ if (isServer) then {
77
addMissionEventHandler ["HandleDisconnect", FUNC(EHHandleDisconnect)];
88
}] call CBA_fnc_addEventHandler;
99
};
10+
11+
// Backpack classnames which will be made invisible instead of being made a chestpack. Useful for items like the vanilla legstrap.
12+
GVAR(exceptions) = [
13+
"B_LegStrapBag_black_F",
14+
"B_LegStrapBag_coyote_F",
15+
"B_LegStrapBag_olive_F",
16+
"rhs_medic_bag"
17+
];

addons/main/functions/fnc_EHAnimDone.sqf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ params ["_unit","_anim"];
2020
if (isNil "_unit") exitWith {["No proper argument(s) given."] call BIS_fnc_error};
2121

2222
_chestpack = [_unit] call FUNC(chestpackContainer);
23+
_chestpackClass = [_unit] call FUNC(chestpack);
2324

2425
//freefall
2526
if ((animationState _unit) find "halofreefall_" isEqualTo 0) then {
26-
_chestpack attachTo [_unit,[0,-0.4,0.05],"pelvis"];
27-
_chestpack setVectorDirandUp [[0,0,1],[0,1,0]];
27+
if !(_chestpackClass in GVAR(exceptions)) then {
28+
_chestpack attachTo [_unit,[0,-0.4,0.05],"pelvis"];
29+
_chestpack setVectorDirandUp [[0,0,1],[0,1,0]];
30+
};
2831
};

addons/main/functions/fnc_EHGetOut.sqf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ params ["_unit","_position","_veh"];
2222
if (isNil "_unit" or isNil "_veh") exitWith {["No proper argument(s) given."] call BIS_fnc_error};
2323

2424
private _chestpack = [_unit] call FUNC(chestpackContainer);
25+
private _chestpackClass = [_unit] call FUNC(chestpack);
2526

26-
[_chestpack, [_unit,[0,-0.03,-0.5],"pelvis"]] remoteExec ["attachTo", 0];
27-
[_chestpack, [[-0.25,-1,0],[0,0,1]]] remoteExec ["setVectorDirAndUp", 0];
28-
[_chestpack, false] remoteExec ["hideObjectGlobal", 0];
27+
if !(_chestpackClass in GVAR(exceptions)) then {
28+
[_chestpack, [_unit,[0,-0.03,-0.5],"pelvis"]] remoteExec ["attachTo", 0];
29+
[_chestpack, [[-0.25,-1,0],[0,0,1]]] remoteExec ["setVectorDirAndUp", 0];
30+
[_chestpack, false] remoteExec ["hideObjectGlobal", 0];
31+
};
2932

3033
if (GVAR(walk)) then {
3134
[_unit, "forceWalk", "BackpackOnChest", true] call ace_common_fnc_statusEffect_set;

0 commit comments

Comments
 (0)