From 6a5d92f9f64b26e7967ec07250c370a1a3a7e117 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 13 Feb 2021 15:24:38 -0600 Subject: [PATCH 1/2] XEH - Use compileScript in CBA_fnc_compileFunction --- addons/xeh/fnc_compileFunction.sqf | 2 +- addons/xeh/fnc_preInit.sqf | 2 +- addons/xeh/fnc_preStart.sqf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/xeh/fnc_compileFunction.sqf b/addons/xeh/fnc_compileFunction.sqf index b82d0c57e..67dbbe14a 100644 --- a/addons/xeh/fnc_compileFunction.sqf +++ b/addons/xeh/fnc_compileFunction.sqf @@ -27,7 +27,7 @@ params [["_funcFile", "", [""]], ["_funcName", "", [""]]]; private _cachedFunc = uiNamespace getVariable _funcName; if (isNil "_cachedFunc") then { - uiNamespace setVariable [_funcName, compileFinal preprocessFileLineNumbers _funcFile]; + uiNamespace setVariable [_funcName, compileScript [_funcFile, true]]; missionNamespace setVariable [_funcName, uiNamespace getVariable _funcName]; } else { if (["compile"] call CBA_fnc_isRecompileEnabled) then { diff --git a/addons/xeh/fnc_preInit.sqf b/addons/xeh/fnc_preInit.sqf index 7616aa7b8..5cf441276 100644 --- a/addons/xeh/fnc_preInit.sqf +++ b/addons/xeh/fnc_preInit.sqf @@ -26,7 +26,7 @@ SLX_XEH_DisableLogging = uiNamespace getVariable ["SLX_XEH_DisableLogging", fals XEH_LOG("PreInit started. v" + getText (configFile >> "CfgPatches" >> "cba_common" >> "versionStr")); SLX_XEH_STR = ""; // does nothing, never changes, backwards compatibility -SLX_XEH_COMPILE = compileFinal "compile preprocessFileLineNumbers _this"; //backwards comps +SLX_XEH_COMPILE = compileFinal "diag_log text format ['[CBA-XEH] old SLX_XEH_COMPILE macro used on %1', _this]; compile preprocessFileLineNumbers _this"; //backwards comps SLX_XEH_COMPILE_NEW = CBA_fnc_compileFunction; //backwards comp SLX_XEH_DUMMY = "Logic"; // backwards comp diff --git a/addons/xeh/fnc_preStart.sqf b/addons/xeh/fnc_preStart.sqf index 2fe34bc69..511a022a2 100644 --- a/addons/xeh/fnc_preStart.sqf +++ b/addons/xeh/fnc_preStart.sqf @@ -23,7 +23,7 @@ with uiNamespace do { XEH_LOG("PreStart started."); - SLX_XEH_COMPILE = compileFinal "compile preprocessFileLineNumbers _this"; //backwards comps + SLX_XEH_COMPILE = compileFinal "diag_log text format ['[CBA-XEH] old SLX_XEH_COMPILE macro used on %1', _this]; compile preprocessFileLineNumbers _this"; //backwards comps SLX_XEH_COMPILE_NEW = CBA_fnc_compileFunction; //backwards comp PREP(initDisplay3DEN); From 7da98159c3158aa339c1e72019dfcf7f0ddca8ad Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 8 Mar 2021 10:54:03 -0600 Subject: [PATCH 2/2] Apply suggestions from code review --- addons/xeh/fnc_preInit.sqf | 2 +- addons/xeh/fnc_preStart.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/xeh/fnc_preInit.sqf b/addons/xeh/fnc_preInit.sqf index 5cf441276..823785b08 100644 --- a/addons/xeh/fnc_preInit.sqf +++ b/addons/xeh/fnc_preInit.sqf @@ -26,7 +26,7 @@ SLX_XEH_DisableLogging = uiNamespace getVariable ["SLX_XEH_DisableLogging", fals XEH_LOG("PreInit started. v" + getText (configFile >> "CfgPatches" >> "cba_common" >> "versionStr")); SLX_XEH_STR = ""; // does nothing, never changes, backwards compatibility -SLX_XEH_COMPILE = compileFinal "diag_log text format ['[CBA-XEH] old SLX_XEH_COMPILE macro used on %1', _this]; compile preprocessFileLineNumbers _this"; //backwards comps +SLX_XEH_COMPILE = compileFinal "diag_log text format ['[CBA-XEH] old SLX_XEH_COMPILE macro used on %1', _this]; compile preprocessFileLineNumbers _this"; //backwards compat SLX_XEH_COMPILE_NEW = CBA_fnc_compileFunction; //backwards comp SLX_XEH_DUMMY = "Logic"; // backwards comp diff --git a/addons/xeh/fnc_preStart.sqf b/addons/xeh/fnc_preStart.sqf index 511a022a2..9f16a3cb1 100644 --- a/addons/xeh/fnc_preStart.sqf +++ b/addons/xeh/fnc_preStart.sqf @@ -23,7 +23,7 @@ with uiNamespace do { XEH_LOG("PreStart started."); - SLX_XEH_COMPILE = compileFinal "diag_log text format ['[CBA-XEH] old SLX_XEH_COMPILE macro used on %1', _this]; compile preprocessFileLineNumbers _this"; //backwards comps + SLX_XEH_COMPILE = compileFinal "diag_log text format ['[CBA-XEH] old SLX_XEH_COMPILE macro used on %1', _this]; compile preprocessFileLineNumbers _this"; //backwards compat SLX_XEH_COMPILE_NEW = CBA_fnc_compileFunction; //backwards comp PREP(initDisplay3DEN);