From da09eea9360fa13b413b58fc68e2d14ec454a0e3 Mon Sep 17 00:00:00 2001 From: jokoho482 Date: Sat, 19 Jun 2021 15:58:35 +0200 Subject: [PATCH] use CompileScript in fnc_compileEventHandlers --- addons/xeh/fnc_compileEventHandlers.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/xeh/fnc_compileEventHandlers.sqf b/addons/xeh/fnc_compileEventHandlers.sqf index 7ba50e8887..939ae188c4 100644 --- a/addons/xeh/fnc_compileEventHandlers.sqf +++ b/addons/xeh/fnc_compileEventHandlers.sqf @@ -89,14 +89,16 @@ if (_allowRecompile) then { //If there is a quote mark in the path, then something went wrong and we got multiple paths, just skip optimization //Example cause: "call COMPILE_FILE(XEH_preInit);call COMPILE_FILE(XEH_preClientInit)" if (_funcPath find "'" == -1) then { - _eventFunc = preprocessFileLineNumbers _funcPath; + _eventFunc = compileScript [_funcPath]; TRACE_2("eventfunction redirected",_customName,_funcPath); }; }; // if (_eventFunc isEqualTo _x) then { diag_log text format ["XEH: Could not recompile [%1-%2]: %3", _eventName, _customName, _eventFunc]; }; }; - - compile _eventFunc // apply return + if (_eventFunc isEqualType "") then { + _eventFunc = compile _eventFunc; + }; + _eventFunc // apply return }; };