Use CBA config functions, return correct value

This commit is contained in:
jonpas 2016-05-22 16:18:24 +02:00
parent d35e89892c
commit bd0e05d7d6
3 changed files with 6 additions and 18 deletions

View File

@ -14,12 +14,4 @@
ACE_DEPRECATED("ace_common_fnc_getConfigType","3.8.0","CBA_fnc_getItemConfig");
params ["_item"];
if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"};
if (isClass (configFile >> "CfgMagazines" >> _item)) exitWith {"CfgMagazines"};
if (isClass (configFile >> "CfgGlasses" >> _item)) exitWith {"CfgGlasses"};
""
configName (configHierarchy (_item call CBA_fnc_getItemConfig) param [1, configNull])

View File

@ -14,10 +14,4 @@
ACE_DEPRECATED("ace_common_fnc_getConfigTypeObject","3.8.0","CBA_fnc_getObjectConfig");
params ["_object"];
if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"};
if (isClass (configFile >> "CfgAmmo" >> _object)) exitWith {"CfgAmmo"};
""
configName (configHierarchy (_item call CBA_fnc_getObjectConfig) param [1, configNull])

View File

@ -15,9 +15,11 @@
params ["_item"];
private _cfgType = [_item] call CBA_fnc_getItemConfig;
private _config = _item call CBA_fnc_getItemConfig;
if (_cfgType == "") exitWith {["", ""]};
if (isNull _config) exitWith {["", ""]};
private _cfgType = configName ((configHierarchy _config) param [1, configNull]);
if (_cfgType == "CfgGlasses") exitWith {["item", "glasses"]};