Skip to content

Commit

Permalink
Merge pull request #1664 from johnb432/disposable-fix-magazine-replac…
Browse files Browse the repository at this point in the history
…ement

Disposable - Fix magazines not being replaced by their disposable counterparts
  • Loading branch information
PabstMirror committed Jul 28, 2024
2 parents 7fb18f4 + 7e418de commit cef8beb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/disposable/fnc_replaceMagazineCargo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ if (magazineCargo _box arrayIntersect GVAR(magazines) isEqualTo []) exitWith {};
private _magazines = magazinesAmmoCargo _box;
clearMagazineCargoGlobal _box;

private _isBackpack = getNumber (configOf _box >> "isBackpack") != -1;
private _isBackpack = getNumber (configOf _box >> "isBackpack") == 1;

{
_x params ["_magazine", "_ammo"];

if (_magazine in GVAR(magazines)) then {
private _loadedLauncher = GVAR(MagazineLaunchers) getVariable _magazine;

// As addWeaponCargoGlobal ignores allowedSlots, check here if launcher is allowed to be placed in a backpack
if (!_isBackpack || {_loadedLauncher in GVAR(BackpackLaunchers)}) then {
_box addWeaponCargoGlobal [_loadedLauncher, 1];
};
Expand Down

0 comments on commit cef8beb

Please sign in to comment.