Gunbag - Fix arsenal caching conflicting with CBA_fnc_setLoadout (#9250)

* Update XEH_preInit.sqf

* Update addons/gunbag/XEH_preInit.sqf

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
johnb432 2023-07-09 23:13:43 +02:00 committed by GitHub
parent 1aa7eb2a1a
commit e181ba5aa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,11 @@ PREP_RECOMPILE_END;
private _gunbagWeapon = _extendedInfo getOrDefault [QGVAR(gunbagWeapon), []]; private _gunbagWeapon = _extendedInfo getOrDefault [QGVAR(gunbagWeapon), []];
if (_gunbagWeapon isNotEqualTo []) then { if (_gunbagWeapon isNotEqualTo []) then {
(backpackContainer _unit) setVariable [QGVAR(gunbagWeapon), _gunbagWeapon, true]; (backpackContainer _unit) setVariable [QGVAR(gunbagWeapon), _gunbagWeapon, true];
// Prevent the arsenal closed event from overwriting new info
if (!isNil QGVAR(arsenalCache)) then {
GVAR(arsenalCache) = _gunbagWeapon;
};
}; };
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;