2024-01-11 20:01:50 +00:00
|
|
|
#include "..\script_component.hpp"
|
2024-01-08 21:22:52 +00:00
|
|
|
/*
|
|
|
|
* Author: Lambda.Tiger
|
2024-01-13 06:35:22 +00:00
|
|
|
* Adds setting defined blacklisted rounds to blacklist
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2024-01-15 19:39:19 +00:00
|
|
|
* None
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2024-01-15 21:37:18 +00:00
|
|
|
* call ace_frag_fnc_addBlackList
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2024-01-15 05:08:37 +00:00
|
|
|
TRACE_1("Beginning blacklist init", GVAR(blackList));
|
2024-01-08 21:22:52 +00:00
|
|
|
|
|
|
|
if (!ADDON) then {
|
|
|
|
[FUNC(initBlackList), [], 1] call CBA_fnc_waitAndExecute;
|
|
|
|
};
|
|
|
|
|
2024-01-13 06:35:22 +00:00
|
|
|
// could improve text parsing of CBA setting string
|
2024-01-15 05:08:37 +00:00
|
|
|
private _convArray = parseSimpleArray GVAR(blackList);
|
2024-01-08 21:22:52 +00:00
|
|
|
|
|
|
|
if (count _convArray == 0 ) exitWith {
|
|
|
|
TRACE_1("Empty blacklist", _convArray);
|
|
|
|
};
|
|
|
|
|
2024-01-13 06:35:22 +00:00
|
|
|
// Add CBA setting blacklist to blacklist and log errors
|
2024-01-08 21:22:52 +00:00
|
|
|
private _errors = 0;
|
|
|
|
private _items = count _convArray;
|
|
|
|
for "_i" from 0 to _items - 1 do {
|
|
|
|
private _ammo = _convArray#_i;
|
|
|
|
if (typeName _ammo isNotEqualTo "STRING") then {
|
|
|
|
INFO_1("Improper ammo string at index %1", _i);
|
|
|
|
INC(_errors);
|
|
|
|
continue;
|
|
|
|
};
|
|
|
|
|
|
|
|
if (!isClass (configFile >> "cfgAmmo" >> _ammo)) then {
|
|
|
|
INFO_1("Ammo class: %1 does not exist", str _ammo);
|
|
|
|
INC(_errors);
|
|
|
|
continue;
|
|
|
|
};
|
|
|
|
|
2024-01-12 07:54:58 +00:00
|
|
|
GVAR(shouldFragCache) set [_convArray#_i, false];
|
2024-01-08 21:22:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-15 19:39:19 +00:00
|
|
|
INFO_2("Initialized blacklist. Total items found: %1, number of items failed: %2", _items, _errors);
|