Make gear check case insensitive

This commit is contained in:
Filip Maciejewski 2019-05-07 23:47:29 +02:00
parent 21348ba082
commit 25d7f28bb8
No known key found for this signature in database
GPG Key ID: 53D1504CC3DBCD46
2 changed files with 11 additions and 1 deletions

View File

@ -83,3 +83,6 @@ if (KP_liberation_arsenalUsePreset) then {
[missionNamespace, true] call BIS_fnc_addVirtualItemCargo;
[missionNamespace, true] call BIS_fnc_addVirtualBackpackCargo;
};
// Lowercase all classnames
KP_liberation_allowed_items = KP_liberation_allowed_items apply {toLower _x};

View File

@ -34,7 +34,14 @@ if (((backpack player) != "") && ((backpack player) != _backpack)) then {_player
{if (_x != "") then {_playerItems pushBackUnique _x;}} forEach (secondaryWeaponItems player);
{if (_x != "") then {_playerItems pushBackUnique _x;}} forEach (handgunItems player);
if (({(_x in KP_liberation_allowed_items) || ((_x find "ACRE") != -1) || ((_x find "tf_") != -1) || ((_x find "TFAR_") != -1)} count _playerItems) != count _playerItems) then {
private _validItemsCount = {
((toLower _x) in KP_liberation_allowed_items)
|| ((_x find "ACRE") != -1)
|| ((_x find "tf_") != -1)
|| ((_x find "TFAR_") != -1)
} count _playerItems);
if ((_validItemsCount != count _playerItems) then {
private _text = format ["[KP LIBERATION] [BLACKLIST] Found %1 at Player %2", (_playerItems - KP_liberation_allowed_items), name player];
_text remoteExec ["diag_log",2];
private _badItems = "";