#2437 - Warn users when mods break XEH

This commit is contained in:
PabstMirror 2015-09-15 12:55:08 -05:00
parent 2c7a2b4140
commit 0e32c28552

View File

@ -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);