From 668ac660037b9abe9d3c90dacf42f75993c571de Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Fri, 8 Feb 2019 09:46:16 +0100 Subject: [PATCH 1/2] Cache incompatibleClasses at preStart --- addons/xeh/fnc_preInit.sqf | 4 ++-- addons/xeh/fnc_preStart.sqf | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/xeh/fnc_preInit.sqf b/addons/xeh/fnc_preInit.sqf index 3c37cecf8..ec9727424 100644 --- a/addons/xeh/fnc_preInit.sqf +++ b/addons/xeh/fnc_preInit.sqf @@ -75,14 +75,14 @@ GVAR(EventsLowercase) = []; GVAR(incompatible) = [] call CBA_fnc_createNamespace; { - private _class = configFile >> "CfgVehicles" >> _x; + private _class = _x; while {isClass _class && {!ISINCOMP(configName _class)}} do { SETINCOMP(configName _class); _class = inheritsFrom _class; }; -} forEach ([false, true] call CBA_fnc_supportMonitor); +} forEach (uiNamespace getVariable [QGVAR(incompatibleClasses), []]); // always recompile extended event handlers #ifdef DEBUG_MODE_FULL diff --git a/addons/xeh/fnc_preStart.sqf b/addons/xeh/fnc_preStart.sqf index 10c4a6362..b10d8b1a5 100644 --- a/addons/xeh/fnc_preStart.sqf +++ b/addons/xeh/fnc_preStart.sqf @@ -65,4 +65,8 @@ with uiNamespace do { diag_log text format ["[XEH]: %1 does not support Extended Event Handlers! Addon: %2", _classname, _addon]; }; } forEach (true call CBA_fnc_supportMonitor); + + // cache incompatible classes that are needed in preInit + private _cfgVehicles = configFile >> "CfgVehicles"; //We need classes in preInit anyway + GVAR(incompatibleClasses) = ([false, true] call CBA_fnc_supportMonitor) apply {_cfgVehicles >> _x}; }; From 104dd760fa9800a7b036060cadda64d48445fa9b Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Fri, 8 Feb 2019 12:28:21 +0100 Subject: [PATCH 2/2] Hacking protection --- addons/xeh/fnc_preInit.sqf | 6 +++--- addons/xeh/fnc_preStart.sqf | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/xeh/fnc_preInit.sqf b/addons/xeh/fnc_preInit.sqf index ec9727424..194621537 100644 --- a/addons/xeh/fnc_preInit.sqf +++ b/addons/xeh/fnc_preInit.sqf @@ -73,16 +73,16 @@ GVAR(EventsLowercase) = []; // generate list of incompatible classes GVAR(incompatible) = [] call CBA_fnc_createNamespace; - +private _cfgVehicles = configFile >> "CfgVehicles"; { - private _class = _x; + private _class = _cfgVehicles >> _x; while {isClass _class && {!ISINCOMP(configName _class)}} do { SETINCOMP(configName _class); _class = inheritsFrom _class; }; -} forEach (uiNamespace getVariable [QGVAR(incompatibleClasses), []]); +} forEach call (uiNamespace getVariable [QGVAR(incompatibleClasses), {[]}]); // always recompile extended event handlers #ifdef DEBUG_MODE_FULL diff --git a/addons/xeh/fnc_preStart.sqf b/addons/xeh/fnc_preStart.sqf index b10d8b1a5..54ca7adc2 100644 --- a/addons/xeh/fnc_preStart.sqf +++ b/addons/xeh/fnc_preStart.sqf @@ -67,6 +67,5 @@ with uiNamespace do { } forEach (true call CBA_fnc_supportMonitor); // cache incompatible classes that are needed in preInit - private _cfgVehicles = configFile >> "CfgVehicles"; //We need classes in preInit anyway - GVAR(incompatibleClasses) = ([false, true] call CBA_fnc_supportMonitor) apply {_cfgVehicles >> _x}; + GVAR(incompatibleClasses) = compileFinal str ([false, true] call CBA_fnc_supportMonitor); };