<commit_before>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//	@file Version: 1.0
//	@file Name: populateVehicleStore.sqf
//	@file Author: [KoS] His_Shadow, AgentRev
//	@file Created: 1/09/2013 05:13
//	@file Args: [vehicle_type]

#include "dialog\vehiclestoreDefines.hpp";
disableSerialization;
private ["_switch", "_dialog", "_vehlisttext", "_vehlist", "_colorlist", "_vehArray", "_noBuzzard", "_playerSideNum", "_vehClass", "_vehPicture", "_vehlistIndex"];
_switch = _this select 0;

// Grab access to the controls
_dialog = findDisplay vehshop_DIALOG;
_vehlisttext = _dialog displayCtrl vehshop_veh_TEXT;
_vehlist = _dialog displayCtrl vehshop_veh_list;
_colorlist = _dialog displayCtrl vehshop_color_list;

lbClear _vehlist;
lbClear _colorlist;
_vehlist lbSetCurSel -1;

_vehArray = switch (_switch) do
{
	case 0: { call landArray };
	case 1: { call armoredArray };
	case 2: { call tanksArray };
	case 3: { call helicoptersArray };
	case 4: { call planesArray };
	case 5: { call boatsArray };
	default { [] };
};

_noBuzzard = ["vehicleStore_noBuzzard", true] call getPublicVar;

_playerSideNum = switch (playerSide) do
{
	case BLUFOR:      { 1 };
	case OPFOR:       { 0 };
	case INDEPENDENT: { 2 };
	default           { 3 };
};

// Populate the vehicle shop list
{
	_x params ["_vehName", "_vehClass"];

	if (!_noBuzzard || {!(_vehClass isKindOf "Plane_Fighter_03_base_F")}) then
	{
		_vehCfg = configFile >> "CfgVehicles" >> _vehClass;

		if (!(_vehClass isKindOf "UAV_02_base_F") || {getNumber (_vehCfg >> "side") == _playerSideNum}) then
		{
			_vehPicture = getText (configFile >> "CfgVehicles" >> _vehClass >> "picture");
			_vehlistIndex = _vehlist lbAdd format ["%1", [_vehName, getText (_vehCfg >> "displayName")] select (_vehName == "")];
			_vehlist lbSetPicture [_vehlistIndex, _vehPicture];
			_vehlist lbSetData [_vehlistIndex, _vehClass];

			[_x, configFile >> "CfgVehicles", _vehlist, _vehlistIndex] call fn_checkStoreItemDLC;
		};
	};
} forEach _vehArray;<commit_msg>Fixed enemy UGVs listed in vehicle store<commit_after>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wastel<EMAIL> *
// ******************************************************************************************
//	@file Version: 1.0
//	@file Name: populateVehicleStore.sqf
//	@file Author: [KoS] His_Shadow, AgentRev
//	@file Created: 1/09/2013 05:13
//	@file Args: [vehicle_type]

#include "dialog\vehiclestoreDefines.hpp";
disableSerialization;
private ["_switch", "_dialog", "_vehlisttext", "_vehlist", "_colorlist", "_vehArray", "_noBuzzard", "_playerSideNum", "_vehClass", "_vehPicture", "_vehlistIndex"];
_switch = _this select 0;

// Grab access to the controls
_dialog = findDisplay vehshop_DIALOG;
_vehlisttext = _dialog displayCtrl vehshop_veh_TEXT;
_vehlist = _dialog displayCtrl vehshop_veh_list;
_colorlist = _dialog displayCtrl vehshop_color_list;

lbClear _vehlist;
lbClear _colorlist;
_vehlist lbSetCurSel -1;

_vehArray = switch (_switch) do
{
	case 0: { call landArray };
	case 1: { call armoredArray };
	case 2: { call tanksArray };
	case 3: { call helicoptersArray };
	case 4: { call planesArray };
	case 5: { call boatsArray };
	default { [] };
};

_noBuzzard = ["vehicleStore_noBuzzard", true] call getPublicVar;

_playerSideNum = switch (playerSide) do
{
	case BLUFOR:      { 1 };
	case OPFOR:       { 0 };
	case INDEPENDENT: { 2 };
	default           { 3 };
};

// Populate the vehicle shop list
{
	_x params ["_vehName", "_vehClass"];

	if (!_noBuzzard || {!(_vehClass isKindOf "Plane_Fighter_03_base_F")}) then
	{
		_vehCfg = configFile >> "CfgVehicles" >> _vehClass;

		if ({_vehClass isKindOf _x} count ["UGV_01_base_F","UAV_02_base_F"] == 0 || {getNumber (_vehCfg >> "side") == _playerSideNum}) then
		{
			_vehPicture = getText (configFile >> "CfgVehicles" >> _vehClass >> "picture");
			_vehlistIndex = _vehlist lbAdd format ["%1", [_vehName, getText (_vehCfg >> "displayName")] select (_vehName == "")];
			_vehlist lbSetPicture [_vehlistIndex, _vehPicture];
			_vehlist lbSetData [_vehlistIndex, _vehClass];

			[_x, configFile >> "CfgVehicles", _vehlist, _vehlistIndex] call fn_checkStoreItemDLC;
		};
	};
} forEach _vehArray;
{'fraction_non_alphanumeric': 0.20456560283687944, 'fraction_numerical': 0.016622340425531915, 'mean_word_length': 5.233425414364641, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 36, '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': '2975451', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1464, 'n_words': 388}