diff --git a/addons/xeh/CfgEventHandlers.hpp b/addons/xeh/CfgEventHandlers.hpp index 8be81befa..a0611a0bc 100644 --- a/addons/xeh/CfgEventHandlers.hpp +++ b/addons/xeh/CfgEventHandlers.hpp @@ -80,9 +80,8 @@ class Extended_Reloaded_EventHandlers {}; // display xeh class Extended_DisplayLoad_EventHandlers { - // fix for preInit = 1 functions not being executed when entering 3den from main menu class Display3DEN { - ADDON = "[] call CBA_fnc_preInit;"; + ADDON = QUOTE(call COMPILE_FILE(XEH_3DENDisplayLoad)); }; }; class Extended_DisplayUnload_EventHandlers {}; diff --git a/addons/xeh/XEH_3DENDisplayLoad.sqf b/addons/xeh/XEH_3DENDisplayLoad.sqf new file mode 100644 index 000000000..9c71622ce --- /dev/null +++ b/addons/xeh/XEH_3DENDisplayLoad.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +// fix for preInit = 1 functions not being executed when entering 3den from main menu +[] call CBA_fnc_preInit; + +// since 1.60, preInit = 1 functions aren't executed when returning from a preview either ... +add3DENEventHandler ["OnMissionPreviewEnd", {[] call CBA_fnc_preInit}];