From 0e32c28552cfebaec89b1a6f4c57d89a2c88e267 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 15 Sep 2015 12:55:08 -0500 Subject: [PATCH] #2437 - Warn users when mods break XEH --- addons/interact_menu/XEH_clientInit.sqf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 31dedfbe22..4a0882b496 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -104,3 +104,25 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; }]; }; }] call EFUNC(common,addEventHandler); + + +//Debug to help end users identify mods that break CBA's XEH +["SettingsInitialized", { + private ["_badClassnames"]; + _badClassnames = []; + { + if ((isNil (format [QGVAR(Act_%1), typeOf _x])) || {isNil (format [QGVAR(SelfAct_%1), typeOf _x])}) then { + if (!((typeOf _x) in _badClassnames)) then { + _badClassnames pushBack (typeOf _x); + ACE_LOGERROR_3("Compile checks bad for (classname: %1)(addon: %2) %1", (typeOf _x), (unitAddons (typeOf _x)), _x); + }; + }; + } forEach (allUnits + vehicles); + if ((count _badClassnames) == 0) then { + ACE_LOGINFO("All compile checks passed"); + } else { + ACE_LOGERROR_1("%1 Classnames failed compile check!!! (bad XEH / missing cba_enable_auto_xeh.pbo)", (count _badClassnames)); + ["ACE Interaction failed to compile for some units (try adding cba_enable_auto_xeh.pbo)"] call BIS_fnc_error; + }; +}] call EFUNC(common,addEventHandler); +