Files
MissionTemplate/framework/vehicleFlags/functions/fn_isClassExcluded.sqf
2024-02-08 15:35:42 -08:00

36 lines
942 B
Plaintext

/*
Used to read vehicle flags config and check provided classname against all present exclusion groups.
Author: IndigoFox
Parameter(s):
0: STRING - Classname of the vehicle to check
*/
#include "..\script_component.hpp"
if (!hasInterface) exitWith {};
params [["_className", "", [""]]];
if (_className == "") exitWith {false};
private _vehicleFlagsCfg = call FUNC(getVehicleFlagsCfg);
private _excludedVehiclesClass = (_vehicleFlagsCfg >> "ExcludedVehicles");
private _exclusionGroups = configProperties [_vehicleFlagsCfg >> "ExcludedVehicles"];
private _isExcluded = false;
{
// Check if the class is directly excluded
private _excludedClasses = _x call BIS_fnc_getCfgDataArray;
if (_className in _excludedClasses) exitWith {
_isExcluded = true;
};
{
if (_className isKindOf _x) exitWith {
_isExcluded = true;
};
} forEach _excludedClasses;
if (_isExcluded) exitWith {};
} forEach _exclusionGroups;
_isExcluded;