diff --git a/addons/help/XEH_preStart.sqf b/addons/help/XEH_preStart.sqf index d4839fb3f..97f9a3eb9 100644 --- a/addons/help/XEH_preStart.sqf +++ b/addons/help/XEH_preStart.sqf @@ -2,3 +2,13 @@ PREP(setVersionLine); PREP(setCreditsLine); + +//Cache for CBA_help_fnc_setCreditsLine +if (!isClass (configFile >> "CfgPatches" >> "CBA_DisableCredits")) then { + uiNamespace setVariable [QGVAR(creditsCache), + "isText (_x >> 'author') && + {getText (_x >> 'author') != localize 'STR_A3_Bohemia_Interactive'} && + {getText (_x >> 'author') != ''} + " configClasses (configFile >> "CfgPatches"); + ]; +}; diff --git a/addons/help/fnc_setCreditsLine.sqf b/addons/help/fnc_setCreditsLine.sqf index f26f4a426..0c37c6c8f 100644 --- a/addons/help/fnc_setCreditsLine.sqf +++ b/addons/help/fnc_setCreditsLine.sqf @@ -29,11 +29,7 @@ if (CBA_DisableCredits) exitWith {}; // find addon with author private _config = configFile >> "CfgPatches"; -private _entry = selectRandom (" - isText (_x >> 'author') && - {getText (_x >> 'author') != localize 'STR_A3_Bohemia_Interactive'} && - {getText (_x >> 'author') != ''} -" configClasses _config); +private _entry = selectRandom (uiNamespace getVariable [QGVAR(creditsCache), []]); if (isNil "_entry") exitWith {};