Skip to content

Commit

Permalink
Cache incompatibleClasses at preStart (#1053)
Browse files Browse the repository at this point in the history
* Cache incompatibleClasses at preStart

* Hacking protection
  • Loading branch information
dedmen authored and commy2 committed Feb 8, 2019
1 parent a2809e1 commit 806e7f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/xeh/fnc_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ GVAR(EventsLowercase) = [];

// generate list of incompatible classes
GVAR(incompatible) = [] call CBA_fnc_createNamespace;

private _cfgVehicles = configFile >> "CfgVehicles";
{
private _class = configFile >> "CfgVehicles" >> _x;
private _class = _cfgVehicles >> _x;

while {isClass _class && {!ISINCOMP(configName _class)}} do {
SETINCOMP(configName _class);

_class = inheritsFrom _class;
};
} forEach ([false, true] call CBA_fnc_supportMonitor);
} forEach call (uiNamespace getVariable [QGVAR(incompatibleClasses), {[]}]);

// always recompile extended event handlers
#ifdef DEBUG_MODE_FULL
Expand Down
3 changes: 3 additions & 0 deletions addons/xeh/fnc_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@ 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
GVAR(incompatibleClasses) = compileFinal str ([false, true] call CBA_fnc_supportMonitor);
};

0 comments on commit 806e7f1

Please sign in to comment.