<commit_before>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//	@file Name: processMagazineCargo.sqf
//	@file Author: AgentRev

private ["_container", "_mags", "_mag", "_fullQty", "_ammoCounts"];
_container = _this select 0;
_mags = _this select 1;

if (isNull _container) exitWith {};

{
	_mag = _x select 0;
	_fullQty = _x select 1;
	_ammoCounts = _x select 2;

	_container addMagazineCargoGlobal [_mag, _fullQty];

	if (!isNil "_ammoCounts") then
	{
		{ _container addMagazineAmmoCargo [_mag, 1, _x] } forEach _ammoCounts;
	};
} forEach _mags;<commit_msg>Fixed saved grenades not throwable on rejoin<commit_after>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//	@file Name: processMagazineCargo.sqf
//	@file Author: AgentRev

private ["_container", "_mags", "_addMag", "_mag", "_fullQty", "_ammoCounts", "_i"];
_container = _this select 0;
_mags = _this select 1;

if (isNull _container) exitWith {};

// the following kludge allows grenades restored to the player inventory to be thrown directly without requiring to drop and retake them
_addMag = switch (_container) do
{
	case (uniformContainer player):  { { for "_i" from 1 to _fullQty do { player addItemToUniform _mag } } };
	case (vestContainer player):     { { for "_i" from 1 to _fullQty do { player addItemToVest _mag } } };
	case (backpackContainer player): { { for "_i" from 1 to _fullQty do { player addItemToBackpack _mag } } };
	default                          { { _container addMagazineCargoGlobal [_mag, _fullQty] } };
};

{
	_mag = _x select 0;
	_fullQty = _x select 1;
	_ammoCounts = _x select 2;

	call _addMag;

	if (!isNil "_ammoCounts") then
	{
		{ _container addMagazineAmmoCargo [_mag, 1, _x] } forEach _ammoCounts;
	};
} forEach _mags;
{'fraction_non_alphanumeric': 0.26017375400091447, 'fraction_numerical': 0.012345679012345678, 'mean_word_length': 4.961852861035422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1999203', 'n_tokens_mistral': 705, 'n_tokens_neox': 652, 'n_words': 210}