Skip to content

Commit 5bdfd2a

Browse files
authored
Merge pull request CBATeam#1467 from CBATeam/useCompileScriptInCacheCode
XEH - Use `compileScript` in `compileEventHandlers`
2 parents 639146b + 08ad3a5 commit 5bdfd2a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

addons/xeh/fnc_compileEventHandlers.sqf

+5-3
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,16 @@ if (_allowRecompile) then {
8989
//If there is a quote mark in the path, then something went wrong and we got multiple paths, just skip optimization
9090
//Example cause: "call COMPILE_FILE(XEH_preInit);call COMPILE_FILE(XEH_preClientInit)"
9191
if (_funcPath find "'" == -1) then {
92-
_eventFunc = preprocessFileLineNumbers _funcPath;
92+
_eventFunc = compileScript [_funcPath];
9393
TRACE_2("eventfunction redirected",_customName,_funcPath);
9494
};
9595
};
9696
// if (_eventFunc isEqualTo _x) then { diag_log text format ["XEH: Could not recompile [%1-%2]: %3", _eventName, _customName, _eventFunc]; };
9797
};
98-
99-
compile _eventFunc // apply return
98+
if (_eventFunc isEqualType "") then {
99+
_eventFunc = compile _eventFunc;
100+
};
101+
_eventFunc // apply return
100102
};
101103
};
102104

0 commit comments

Comments
 (0)