
params [
	["_player", objNull, [objNull]]
];

if (!isPlayer _player) exitWith { diag_log("exitWith logPlayerInventory")};

_items = [];
_items append uniformItems _player;
_items append vestItems _player;
_items append backpackItems _player;
_items pushback hmd _player;
_items pushback binocular _player;
_items append primaryWeaponItems _player;

_unlisted = [];

_restricted = [];
_blacklist = [];
_tabbed = [];
_meme = [];

{


	_blackListItems = [ // Items that NO member is allowed to use.
		"17BN_ANPVS14", // NVG AN/PVS-14
		"USP_PVS_14", // NVG AN/PVS-14
		"USP_PVS_15", // NVG AN/PVS-15
		"rhsusf_ANPVS_14", // NVG AN/PVS-14
		"ej_VPS15", // NVG AN/PVS-15
		"rhsusf_ANPVS_15", // NVG AN/PVS-15
		"ej_PVS15D", // NVG AN/PVS-15
		"UK3CB_M16_Carbine", // M16 Series
		"UK3CB_M16A1", // M16 Series
		"UK3CB_M16A1_LSW", // M16 Series
		"UK3CB_M16A2", // M16 Series
		"UK3CB_M16A2_UGL", // M16 Series
		"UK3CB_M16A3", // M16 Series
		"rhs_weap_m16a4", // M16 Series
		"rhs_weap_m16a4_carryhandle", // M16 Series
		"rhs_weap_m16a4_carryhandle_M203", // M16 Series
		"rhs_weap_m16a4_imod", // M16 Series
		"rhs_weap_m16a4_imod_M203", // M16 Series
		"rhs_weap_m27iar", // M27 Series
		"rhs_weap_m27iar_grip", // M27 Series
		"UK3CB_G36_MLIC", // G36 Series
		"UK3CB_G36_MLIC_K", // G36 Series
		"UK3CB_G36_MLIC_C", // G36 Series
		"UK3CB_G36_KSK_K", // G36 Series
		"UK3CB_G36_KSK", // G36 Series
		"UK3CB_G36A1", // G36 Series
		"UK3CB_AG36A1", // G36 Series
		"UK3CB_G36A1_K", // G36 Series
		"UK3CB_G36A1_C", // G36 Series
		"UK3CB_G36E1", // G36 Series
		"UK3CB_AG36E1", // G36 Series
		"UK3CB_G36E1_K", // G36 Series
		"UK3CB_G36E1_C", // G36 Series
		"UK3CB_AG36_MLIC", // G36 Series
		"UK3CB_G36V", // G36 Series
		"UK3CB_AG36V", // G36 Series
		"UK3CB_G36_TAC", // G36 Series
		"UK3CB_G36V_K", // G36 Series
		"UK3CB_AG36_TAC_K", // G36 Series
		"UK3CB_G36V_C", // G36 Series
		"UK3CB_G36_TAC_C", // G36 Series
		"UK3CB_G36_LSW", // G36 Series
		"rhs_weap_g36kv", // G36 Series
		"rhs_weap_g36kv_ag36", // G36 Series
		"rhs_weap_g36c", // G36 Series
		"Tier1_SIG_CMX_115_Virtus_300BLK", // MCX 300 Blackout
		"Tier1_SIG_CMX_115_Virtus_300BLK_Black", // MCX 300 Blackout
		"Tier1_SIG_CMX_115_Virtus_300BLK_Desert", // MCX 300 Blackout
		"Tier1_SIG_CMX_115_Virtus_300BLK_FDE", // MCX 300 Blackout
		"UK3CB_M14", // M14 Series
		"UK3CB_M14_Railed", // M14 Series
		"UK3CB_M14DMR", // M14 Series
		"UK3CB_M14DMR_BLK", // M14 Series
		"UK3CB_M14DMR_Railed", // M14 Series
		"UK3CB_M14DMR_Railed_BLK", // M14 Series
		"srifle_DMR_06_hunter_F", // M14 Series
		"srifle_DMR_06_camo_F", // M14 Series
		"srifle_DMR_06_olive_F", // M14 Series
		"rhs_weap_m14", // M14 Series
		"rhs_weap_m14_d", // M14 Series
		"rhs_weap_m14_fiberglass", // M14 Series
		"rhs_weap_m14_rail", // M14 Series
		"rhs_weap_m14_rail_d", // M14 Series
		"rhs_weap_m14_rail_fiberglass", // M14 Series
		"rhs_weap_m14_rail_wd", // M14 Series
		"rhs_weap_m14_ris", // M14 Series
		"rhs_weap_m14_ris_d", // M14 Series
		"rhs_weap_m14_ris_fiberglass", // M14 Series
		"rhs_weap_m14_ris_wd", // M14 Series
		"rhs_weap_m14_wd", // M14 Series
		"rhs_weap_m14_weap_m14ebrri", // M14 Series
		"rhs_weap_m14_socom", // M14 Series
		"rhs_weap_m14_socom_rail", // M14 Series
		"srifle_EBR_F", // Mk14 Series
		"UK3CB_FNFAL_OSW", // FN_FAL Series
		"UK3CB_FNFAL_OSW_GL", // FN_FAL Series
		"UK3CB_FNFAL_FULL", // FN_FAL Series
		"UK3CB_FNFAL_FULL_RAILS", // FN_FAL Series
		"UK3CB_FNFAL_FOREGRIP", // FN_FAL Series
		"UK3CB_FNFAL_PARA", // FN_FAL Series
		"UK3CB_FNFAL_PARA_RAILS", // FN_FAL Series
		"UK3CB_FNFAL_STG58", // FN_FAL Series
		"SMA_ACRREM", //Remington ACR 556+6.5
		"SMA_ACRREMAFGCQB",  //Remington ACR 556+6.5
		"SMA_ACRREMAFG", //Remington ACR 556+6.5
		"SMA_ACRREMMOECQB", //Remington ACR 556+6.5
		"SMA_ACRREMMOE", //Remington ACR 556+6.5
		"SMA_ACRREMblk", //Remington ACR 556+6.5
		"SMA_ACRREMAFGCQBblk", //Remington ACR 556+6.5
		"SMA_ACRREMAFGblk", //Remington ACR 556+6.5
		"SMA_ACRREMMOECQBblk", //Remington ACR 556+6.5
		"SMA_ACRREMMOEblk", //Remington ACR 556+6.5
		"SMA_ACRREMGL_B", //Remington ACR 556+6.5
		"SMA_ACRREMCQBGL", //Remington ACR 556+6.5
		"SMA_ACRREMGL", //Remington ACR 556+6.5
		"LMG_Mk200_F", //Mk200 Series
		"LMG_Mk200_black_F" //Mk200 Series
	]

	_restrictedItems = [ // Items that are allowed for Specific USE Case (RRC / Marksman / etc.)
		"A3_GPNVG18b_REC_TI", // Thermal Quad
		"A3_GPNVG18_REC_TI", // Thermal Quad
		"A3_GPNVG18b_TI", // Thermal Quad
		"A3_GPNVG18_TI", // Thermal Quad
		"A3_GPNVG18b_REC_BLK_TI", // Thermal Quad
		"A3_GPNVG18_REC_BLK_TI", // Thermal Quad
		"A3_GPNVG18b_BLK_TI", // Thermal Quad
		"A3_GPNVG18_BLK_TI", // Thermal Quad
		"NVGogglesB_gry_F", // ENVG
		"NVGogglesB_grn_F", // ENVG
		"NVGogglesB_blk_F", // ENVG
		"optic_Nightstalker", // Thermal Optic
		"rhsusf_acc_anpas13gv1", // Thermal Optic
		"Tier1_ANPVS10_Tan", // Thermal Optic
		"rhsusf_acc_anpvs27", // Thermal Optic
		"optic_tws_mg", // Thermal Optic
		"optic_tws", // Thermal Optic
		"Tier1_ATACR18_ADM_Black", //Nightforce Series Optic
		"Tier1_ATACR18_ADM_Desert", //Nightforce Series Optic
		"Tier1_ATACR18_ADM_Desert_Vanilla", //Nightforce Series Optic
		"Tier1_ATACR18_ADM_Black_Vanilla", //Nightforce Series Optic
		"Tier1_ATACR18_ADM_T1_Black", //Nightforce Series Optic
		"Tier1_ATACR18_ADM_T1_Desert", //Nightforce Series Optic
		"Tier1_ATACR18_ADM_T1_Black_Vanilla", //Nightforce Series Optic
		"Tier1_ATACR18_ADM_T1_Desert_Vanilla", //Nightforce Series Optic
		"Tier1_ATACR18_Geissele_Black", //Nightforce Series Optic
		"Tier1_ATACR18_Geissele_Desert", //Nightforce Series Optic
		"Tier1_ATACR18_Geissele_Black_Vanilla", //Nightforce Series Optic
		"Tier1_ATACR18_Geissele_Desert_Vanilla", //Nightforce Series Optic
		"Tier1_ATACR18_Geissele_Docter_Black", //Nightforce Series Optic
		"Tier1_ATACR18_Geissele_Docter_Desert", //Nightforce Series Optic
		"Tier1_ATACR18_Geissele_Docter_Black_Vanilla", //Nightforce Series Optic
		"Tier1_ATACR18_Geissele_Docter_Desert_Vanilla", //Nightforce Series Optic
		"optic_lrps", //Nightforce Series Optic
		"optic_lrps_ghex_F", //Nightforce Series Optic
		"optic_lrps_tna_F", //Nightforce Series Optic
		"ACE_optic_LRPS_2D", //Nightforce Series Optic
		"ACE_optic_LRPS_PIP" //Nightforce Series Optic
	];

	_tabbedItems = [ // Items that are allowed for individuals with Ranger Tab
		"arifle_SPAR_03_snd_F", // HK417 Series
		"arifle_SPAR_03_blk_F", // HK417 Series
		"arifle_SPAR_03_khk_F", // HK417 Series
		"SMA_HK417", // HK417 Series
		"SMA_HK417vfg", // HK417 Series
		"SMA_HK417_16in", // HK417 Series
		"rhs_weap_SCARH_CQC", // Scar H Series
		"rhs_weap_SCARH_FDE_CQC", // Scar H Series
		"rhs_weap_SCARH_FDE_LB", // Scar H Series
		"rhs_weap_SCARH_LB", // Scar H Series
		"rhs_weap_SCARH_FDE_STD", // Scar H Series
		"rhs_weap_SCARH_STD", // Scar H Series
		"rhs_weap_SCARH_USA_CQC", // Scar H Series
		"rhs_weap_SCARH_USA_LB", // Scar H Series
		"rhs_weap_SCARH_USA_STD", // Scar H Series
		"SMA_Mk17", // Scar H Series
		"SMA_Mk17_black", // Scar H Series
		"SMA_Mk17_green", // Scar H Series
		"SMA_Mk17_EGML", // Scar H Series
		"SMA_Mk17_EGML_black", // Scar H Series
		"SMA_Mk17_EGML_green", // Scar H Series
		"SMA_Mk17_16", // Scar H Series
		"SMA_Mk17_16_black", // Scar H Series
		"SMA_Mk17_16_green", // Scar H Series
		"Tier1_SR25", // SR-25 Series
		"Tier1_SR25_tan", // SR-25 Series
		"Tier1_SR25_ec", // SR-25 Series
		"Tier1_SR25_ec_tan", // SR-25 Series
		"arifle_MXC_F", // MXC Series
		"arifle_MXC_black_F", // MXC Series
		"arifle_MXC_khk_F", // MXC Series
		"arifle_MXM_F", // MXM Series
		"arifle_MXM_black_F", // MXM Series
		"arifle_MXM_khk_F", // MXM Series
		"arifle_MX_F", // MX Series
		"arifle_MX_black_F", // MX Series
		"arifle_MX_khk_F", // MX Series
		"arifle_MX_GL_F", // MX 3GL Series
		"arifle_MX_GL_black_F", // MX 3GL Series
		"arifle_MX_GL_khk_F", // MX 3GL Series
		"arifle_MX_SW_F", // MX LSW Series
		"arifle_MX_SW_black_F", // MX LSW Series
		"arifle_MX_SW_khk_F", // MX LSW Series
		"Tier1_MK48_Mod0", // Mk48 Series
		"Tier1_MK48_Mod0_Desert", // Mk48 Series
		"Tier1_MK48_Mod0_Para", // Mk48 Series
		"Tier1_MK48_Mod0_Para_Desert", // Mk48 Series
		"Tier1_MK48_Mod1", // Mk48 Series
		"Tier1_MK48_Mod1_Desert" // Mk48 Series
	]

	_memeItems = [ // Items that serve no purpose other than to MEME
		"UK3CB_Cocaine_Brick",
		"ACE_Banana"
	] 









	_item = _x;
	_modes = getArray(configfile >> "CfgWeapons" >> _item >> "visionMode");

	_subModes = [configfile >> "CfgWeapons" >> _item >> "ItemInfo" >> "OpticsModes", 1] call BIS_fnc_returnChildren;
	
	{
		_modes append getArray( _x >> "visionMode" );
	} forEach _subModes;


	if ( _item in _blackListItems ) then {
		_blacklist pushBackUnique _item;
	};

	if ( _item in _restrictedItems ) then {
		_restrcited pushBackUnique _item;
	};

	if ( _item in _tabbedItems ) then {
		_tabbed pushBackUnique _item;
	};

	if ( _item in _memeItems ) then {
		_meme pushBackUnique _item;
	};
	
	if ((count _modes) isNotEqualTo 0) then {
		_modes = _modes apply { toLower _x };
		if ( "ti" in _modes ) then {	
			_unlisted pushBackUnique _item;
		};
	};

} forEach _items;

{
	diag_log text format["[MILSIM] (logPlayerInventory): %1 has a blacklisted inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
} forEach _blacklist;

{
	diag_log text format["[MILSIM] (logPlayerInventory): %1 has a restricted inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
} forEach _restrcited;

{
	diag_log text format["[MILSIM] (logPlayerInventory): %1 has a tabbed inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
} forEach _tabbed;

{
	diag_log text format["[MILSIM] (logPlayerInventory): %1 has a meme inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
} forEach _meme;

{
	diag_log text format["[MILSIM] (logPlayerInventory): %1 has an unlisted thermal item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];	
} forEach _unlisted;

if (((count _blacklist) isEqualTo 0) && ((count _restrcited) isEqualTo 0) && ((count _tabbed) isEqualTo 0) && ((count _meme) isEqualTo 0) && ((count _unlisted) isEqualTo 0)) then {
	diag_log text format["[MILSIM] (logPlayerInventory): %1 inventory in fully base inventory compliant.", name _player];
};

nil