Skip to content

Commit

Permalink
XEH - Fix CBA functions not available in editor when using RECOMPILE …
Browse files Browse the repository at this point in the history
…(DEV Only)

Ref #1336
  • Loading branch information
PabstMirror committed May 15, 2020
1 parent 5c478a0 commit 063155a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions addons/jr/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CfgFunctions {
class compatibleItems {
description = "Get list of compatible attachments for a weapon";
file = QPATHTOF(fnc_compatibleItems.sqf);
RECOMPILE;
};
};
};
Expand Down
2 changes: 2 additions & 0 deletions addons/xeh/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ class CfgFunctions {
class preInit {
preInit = 1;
file = PATHTOF(fnc_preInit.sqf);
// This file cannot be recompiled or it will be undefined at preInit
};
class postInit {
postInit = 1;
file = PATHTOF(fnc_postInit.sqf);
RECOMPILE;
};
};
};
Expand Down
12 changes: 12 additions & 0 deletions addons/xeh/fnc_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ SLX_XEH_DisableLogging = uiNamespace getVariable ["SLX_XEH_DisableLogging", fals

XEH_LOG("PreInit started. v" + getText (configFile >> "CfgPatches" >> "cba_common" >> "versionStr"));

#ifdef RECOMPILE
if (isNil "CBA_fnc_compileFunction") then {
INFO("Recompiling all CBA Functions [for use in threeden]");
{
{
private _fncName = format ["CBA_fnc_%1", configName _x];
_fncName call BIS_fnc_recompile;
} forEach (configProperties [_x]);
} forEach (configProperties [configFile >> "CfgFunctions" >> "CBA"]);
};
#endif

SLX_XEH_STR = ""; // does nothing, never changes, backwards compatibility
SLX_XEH_COMPILE = compileFinal "compile preprocessFileLineNumbers _this"; //backwards comps
SLX_XEH_COMPILE_NEW = CBA_fnc_compileFunction; //backwards comp
Expand Down

0 comments on commit 063155a

Please sign in to comment.