diff --git a/Sources/epoch_code/compile/EPOCH_consumeItem.sqf b/Sources/epoch_code/compile/EPOCH_consumeItem.sqf index b69a4878..11801dd4 100644 --- a/Sources/epoch_code/compile/EPOCH_consumeItem.sqf +++ b/Sources/epoch_code/compile/EPOCH_consumeItem.sqf @@ -19,7 +19,8 @@ private ["_buildClass","_buildingCountLimit","_buildingJammerRange","_canCapacit EPOCH_InteractedItem params ["_text","_item","_pic"]; _cfgBaseBuilding = 'CfgBaseBuilding' call EPOCH_returnConfig; -_cfgItemInteractions = (('CfgItemInteractions' call EPOCH_returnConfig) >> _item); +_cfgItemInteractions = ["CfgItemInteractions", _item] call EPOCH_returnConfigV2; +// _cfgItemInteractions = (('CfgItemInteractions' call EPOCH_returnConfig) >> _item); _interactOption = getNumber(_cfgItemInteractions >> "interactAction"); _interactAttributes = getArray(_cfgItemInteractions >> "interactAttributes"); diff --git a/Sources/epoch_code/compile/functions/EPOCH_returnConfigV2.sqf b/Sources/epoch_code/compile/functions/EPOCH_returnConfigV2.sqf new file mode 100644 index 00000000..fe18d41a --- /dev/null +++ b/Sources/epoch_code/compile/functions/EPOCH_returnConfigV2.sqf @@ -0,0 +1,36 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: + + Description: + Returns missionConfigFile if exists otherwise uses configFile + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_returnConfig.sqf + + Example: + [['CfgCrafting', 'item1']] call EPOCH_returnConfigV2; + + Parameter(s): + _this: ARRAY of STRING/s - Config class name Array + + Returns: + CONFIG +*/ +//[[[cog import generate_private_arrays ]]] +private ["_missionconfig","_return"]; +//[[[end]]] +_return = configfile; +_missionconfig = missionConfigFile; +{ + _return = (_return >> _x); + _missionconfig = (_missionconfig >> _x); +} forEach _this; +if (isClass _missionconfig) then{ + _return = _missionconfig; +}; +_return diff --git a/Sources/epoch_code/compile/inventory/EPOCH_itemInteractClick.sqf b/Sources/epoch_code/compile/inventory/EPOCH_itemInteractClick.sqf index 5e9c53e5..0d50f41d 100644 --- a/Sources/epoch_code/compile/inventory/EPOCH_itemInteractClick.sqf +++ b/Sources/epoch_code/compile/inventory/EPOCH_itemInteractClick.sqf @@ -21,7 +21,8 @@ _buttonTXT = ""; _magCount = 1; _interactActions = []; _config = (configfile >> "CfgWeapons" >> _data); -_cfgItemInteractions = (('CfgItemInteractions' call EPOCH_returnConfig) >> _data); +// _cfgItemInteractions = (('CfgItemInteractions' call EPOCH_returnConfig) >> _data); +_cfgItemInteractions = ["CfgItemInteractions", _data] call EPOCH_returnConfigV2; if (isClass (_config)) then { _type = getNumber (_config >> "type"); _interactOption = getNumber (_cfgItemInteractions >> "interactAction"); diff --git a/Sources/epoch_config/Configs/CfgClientFunctions.hpp b/Sources/epoch_config/Configs/CfgClientFunctions.hpp index 3359f4b9..cd4f9a14 100644 --- a/Sources/epoch_config/Configs/CfgClientFunctions.hpp +++ b/Sources/epoch_config/Configs/CfgClientFunctions.hpp @@ -104,6 +104,7 @@ class CfgClientFunctions { class worldObjectType {}; class returnConfig {}; + class returnConfigV2 {}; class colorRange {}; class convertTemp {}; class fnc_playerDeath {};