diff --git a/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf b/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf index f448b91b646..b5b159b7c28 100644 --- a/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_canRepackMagazine.sqf @@ -25,5 +25,5 @@ private _maxAmmoCount = getNumber (configFile >> "CfgMagazines" >> _magazine >> _magazineType == _magazine // Magazine is of given type && {_ammoCount > 0 && {_ammoCount < _maxAmmoCount}} // Is a partial magazine - && {!_isLoaded || {[_unit, _magazineType] call CBA_fnc_canAddItem}} // In inventory or can be moved into it + && {!_isLoaded || {GVAR(repackLoadedMagazines) && {[_unit, _magazineType] call CBA_fnc_canAddItem}}} // In inventory or can be moved into it } count magazinesAmmoFull _unit > 1 diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index 3c87b434a71..70018cd31d3 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -27,7 +27,7 @@ private _unitMagCounts = []; private _xFullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _xClassname >> "count"); //for every partial magazine, that is either in inventory or can be moved there - if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {[_player, _xClassname] call CBA_fnc_canAddItem}}) then { + if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {GVAR(repackLoadedMagazines) && {[_player, _xClassname] call CBA_fnc_canAddItem}}}) then { private _index = _unitMagazines find _xClassname; if (_index == -1) then { _unitMagazines pushBack _xClassname; diff --git a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf index b776d4bcdbd..f62e6dc0e37 100644 --- a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf @@ -39,7 +39,7 @@ private _startingAmmoCounts = []; if (_xClassname == _magazineClassname && {_xCount != _fullMagazineCount && {_xCount > 0}}) then { if (_xLoaded) then { //Try to Remove from weapon and add to inventory, otherwise ignore - if ([_player, _magazineClassname] call CBA_fnc_canAddItem) then { + if (GVAR(repackLoadedMagazines) && {[_player, _magazineClassname] call CBA_fnc_canAddItem}) then { switch (_xType) do { case (1): {_player removePrimaryWeaponItem _magazineClassname}; case (2): {_player removeHandgunItem _magazineClassname}; @@ -48,6 +48,7 @@ private _startingAmmoCounts = []; }; _player addMagazine [_magazineClassname, _xCount]; _startingAmmoCounts pushBack _xCount; + [LLSTRING(repackLoadedMagazinesHint)] call EFUNC(common,displayTextStructured); }; } else { _startingAmmoCounts pushBack _xCount; diff --git a/addons/magazinerepack/initSettings.sqf b/addons/magazinerepack/initSettings.sqf index cb7e2a6e703..d489864a442 100644 --- a/addons/magazinerepack/initSettings.sqf +++ b/addons/magazinerepack/initSettings.sqf @@ -23,3 +23,11 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [1, 10, 8, 1], 1 ] call CBA_fnc_addSetting; + +[ + QGVAR(repackLoadedMagazines), "CHECKBOX", + LSTRING(repackLoadedMagazines), + _category, + true, + 0 +] call CBA_fnc_addSetting; diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index 18c37c7289b..106c44c23d0 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -166,5 +166,11 @@ %1個滿的與%2個部分的 %1 Dolu ve %2 Partial + + Repack Loaded Magazines + + + Repacking magazines, weapon unloaded +