@@ -30,14 +30,14 @@ private _chestpackVariables = [_unit] call FUNC(chestpackVariables);
3030private _chestpackAcreRadios = [_unit ] call FUNC(chestpackAcreRadios);
3131
3232private _shouldSwitchNVGs = currentVisionMode _unit ! = 0 ;
33- private _acreEnabled = [ _unit ] call FUNC(acreIsInitialized) ;
33+ private _acreLoaded = (missionNamespace getVariable [QGVAR(isACRELoaded), false ]) && { ! isNil " acre_api_fnc_getCurrentRadioList " } ;
3434
3535// make sure the player has chest-pack and backpack
3636if ((_backpack isEqualTo " " ) or ([_unit ] call FUNC(chestpack)) isEqualTo " " ) exitWith {};
3737
3838// If ACRE is running, capture per-radio state for radios inside the backpack that will become the new chestpack.
3939// Also filter ACRE radio ID classnames out of the stored loadout to avoid re-adding IDed radios later.
40- if (_acreEnabled ) then {
40+ if (_acreLoaded ) then {
4141 _backpackAcreRadios = [_unit , _backpackLoadoutRaw ] call FUNC(acreCaptureRadioStatesFromLoadout);
4242 if ! (isNil " acre_api_fnc_filterUnitLoadout" ) then {
4343 _unitLoadout = [_unitLoadout ] call acre_api_fnc_filterUnitLoadout ;
@@ -56,11 +56,11 @@ if (_acreEnabled) then {
5656removeBackpackGlobal _unit ;
5757
5858private _preRadios = [];
59- if (_acreEnabled && {_chestpackAcreRadios isNotEqualTo []}) then {
59+ if (_acreLoaded && {_chestpackAcreRadios isNotEqualTo []}) then {
6060 _preRadios = [_unit ] call FUNC(acreGetUnitRadioIds);
6161};
6262
63- if (_acreEnabled ) then {
63+ if (_acreLoaded ) then {
6464 // Avoid setUnitLoadout when ACRE is running to prevent full radio re-init.
6565 _unit addBackpackGlobal _chestpack ;
6666 private _backpackNew = backpackContainer _unit ;
@@ -76,7 +76,7 @@ if (GVAR(isACEAXLoaded)) then {
7676 [_unit , [_unit ] call aceax_gearinfo_fnc_getTextureOptions ] call aceax_gearinfo_fnc_setTextureOptions ;
7777};
7878
79- if (! _acreEnabled && {_shouldSwitchNVGs }) then {
79+ if (! _acreLoaded && {_shouldSwitchNVGs }) then {
8080 _unit action [" NVGoggles" , _unit ];
8181};
8282
@@ -87,7 +87,7 @@ private _backpackNew = backpackContainer _unit;
8787} forEach _chestpackVariables ;
8888
8989// Restore ACRE radio settings for radios that were inside the chestpack.
90- if (_acreEnabled && {_chestpackAcreRadios isNotEqualTo []}) then {
90+ if (_acreLoaded && {_chestpackAcreRadios isNotEqualTo []}) then {
9191 [_unit , _preRadios , _chestpackAcreRadios ] call FUNC(acreRestoreRadioStates);
9292};
9393
0 commit comments