summaryrefslogtreecommitdiffstats
path: root/Common/Functions/Common_GetGroupFromConfig.sqf
blob: 54270579750c32c96eb0d64ed0aaabf40169417c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Private ['_config','_faction','_group','_kind','_side','_type'];
_side = _this select 0;
_faction = _this select 1;
_kind = _this select 2;
_type = _this select 3;

_config = configFile >> "CfgGroups" >> _side >> _faction >> _kind >> _type;
_group = [];

if (isClass _config) then {
	for "_j" from 0 to ((count _config) - 1) do {
		private ["_mclass"];
		_mclass = _config select _j;
		
		if (isClass (_mclass)) then {
			_group = _group + [getText(_mclass >> "vehicle")];
		};
	};
} else {
	diag_log Format ["[WFBE (ERROR)][frameno:%1 | ticktime:%2] Common_GetGroupFromConfig: Entry (configFile >> 'CfgGroups' >> '%3' >> '%4' >> '%5' >> '%6') is not a valid group config.",diag_frameno,diag_tickTime,_side,_faction,_kind,_type];
};

_group