diff --git a/addons/xeh/fnc_compileEventHandlers.sqf b/addons/xeh/fnc_compileEventHandlers.sqf index 5207f8003..42d258eef 100644 --- a/addons/xeh/fnc_compileEventHandlers.sqf +++ b/addons/xeh/fnc_compileEventHandlers.sqf @@ -79,7 +79,7 @@ private _resultNames = []; _result pushBack ["", _eventName, _eventFunc]; _resultNames pushBack _customName; } forEach configProperties [_baseConfig >> XEH_FORMAT_CONFIG_NAME(_eventName)]; -} forEach ["preStart", "preInit", "postInit"]; +} forEach ["preInit", "postInit"]; // object events { diff --git a/addons/xeh/fnc_postInit_unscheduled.sqf b/addons/xeh/fnc_postInit_unscheduled.sqf index d868773f8..af9ca52b2 100644 --- a/addons/xeh/fnc_postInit_unscheduled.sqf +++ b/addons/xeh/fnc_postInit_unscheduled.sqf @@ -26,7 +26,7 @@ if (CBA_missionTime == -1) then { // call PostInit events { if (_x select 1 == "postInit") then { - call (_x select 2); + [] call (_x select 2); }; } forEach GVAR(allEventHandlers); diff --git a/addons/xeh/fnc_preInit.sqf b/addons/xeh/fnc_preInit.sqf index 7acde1c12..22f033a63 100644 --- a/addons/xeh/fnc_preInit.sqf +++ b/addons/xeh/fnc_preInit.sqf @@ -89,7 +89,7 @@ GVAR(fallbackRunning) = false; { if (_x select 0 == "") then { if (_x select 1 == "preInit") then { - call (_x select 2); + [] call (_x select 2); }; } else { _x params ["_className", "_eventName", "_eventFunc", "_allowInheritance", "_excludedClasses"]; diff --git a/addons/xeh/fnc_preStart.sqf b/addons/xeh/fnc_preStart.sqf index cbc6f6508..c3f54663b 100644 --- a/addons/xeh/fnc_preStart.sqf +++ b/addons/xeh/fnc_preStart.sqf @@ -31,10 +31,24 @@ with uiNamespace do { // call PreStart events { - if (_x select 1 == "preStart") then { - call (_x select 2); + private _eventFunc = ""; + + if (isClass _x) then { + private _entry = _x >> "init"; + + if (isText _entry) then { + _eventFunc = _eventFunc + getText _entry + ";"; + }; + } else { + if (isText _x) then { + _eventFunc = getText _x + ";"; + }; + }; + + if !(_eventFunc isEqualTo "") then { + [] call compile _eventFunc; }; - } forEach (configFile call CBA_fnc_compileEventHandlers); + } forEach configProperties [configFile >> XEH_FORMAT_CONFIG_NAME("preStart")]; #ifdef DEBUG_MODE_FULL diag_log text format ["isScheduled = %1", call CBA_fnc_isScheduled];