diff --git a/addons/common/fnc_removeMagazineCargo.sqf b/addons/common/fnc_removeMagazineCargo.sqf index 5b101d133..79ebd3977 100644 --- a/addons/common/fnc_removeMagazineCargo.sqf +++ b/addons/common/fnc_removeMagazineCargo.sqf @@ -64,6 +64,13 @@ private _magazinesAmmo = magazinesAmmoCargo _container; // Clear cargo space and readd the items as long it's not the type in question clearMagazineCargoGlobal _container; +// Engine will agressively cleanup "empty" ground containers, even if magazines are re-added in same frame, so re-create a new container +private _containerType = typeOf _container; +if (((toLower _containerType) in ["groundweaponholder", "weaponholdersimulated"]) +&& {(weaponCargo _container) isEqualTo []} && {(itemCargo _container) isEqualTo []} && {(backpackCargo _container) isEqualTo []}) then { + _container = createVehicle [_containerType, getPosATL _container, [], 0, "CAN_COLLIDE"]; +}; + { _x params ["_magazineClass", "_magazineAmmo"];