From 04a3ba8bb4341ac3a8f42bdf51c06307aaece7b6 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 17 Mar 2024 13:41:09 +0100 Subject: [PATCH] Moved event to preInit --- addons/frag/XEH_postInit.sqf | 14 ++------------ addons/frag/XEH_preInit.sqf | 8 +++++++- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index 21ba57c9fb..1da4723154 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -1,19 +1,9 @@ #include "script_component.hpp" +#ifdef DEBUG_MODE_DRAW [ "CBA_settingsInitialized", { - if (isServer) then { - call FUNC(initMaterialCache); - [ - QEGVAR(common,setShotParents), - { - (_this#0) setVariable [QGVAR(shotParent), [_this#1, _this#2]]; - } - ] call CBA_fnc_addEventHandler; - }; - - #ifdef DEBUG_MODE_DRAW [QGVAR(dev_clearTraces), LINKFUNC(dev_clearTraces)] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; @@ -49,9 +39,9 @@ ] call EFUNC(interact_menu,addActionToClass); } ] call CBA_fnc_addEventHandler; - #endif } ] call CBA_fnc_addEventHandler; +#endif #ifdef LOG_FRAG_INFO [true, true, 30] call FUNC(dev_debugAmmo); diff --git a/addons/frag/XEH_preInit.sqf b/addons/frag/XEH_preInit.sqf index 8120192a44..68d608c87f 100644 --- a/addons/frag/XEH_preInit.sqf +++ b/addons/frag/XEH_preInit.sqf @@ -6,7 +6,8 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; -GVAR(spallMaterialCache) = createHashMap; +call FUNC(initMaterialCache); + GVAR(spallInfoCache) = createHashMap; GVAR(shouldSpallCache) = createHashMap; GVAR(nextSpallAllowTime) = -1; @@ -21,8 +22,13 @@ GVAR(dev_trackLines) = createHashMap; GVAR(dev_hitBoxes) = createHashMap; GVAR(dev_eventSpheres) = []; GVAR(dev_drawPFEH) = -1; + #ifdef DEBUG_MODE_DRAW #include "initSettingsDebug.inc.sqf" #endif +if (isServer) then { + [QEGVAR(common,setShotParents), {(_this#0) setVariable [QGVAR(shotParent), [_this#1, _this#2]]}] call CBA_fnc_addEventHandler; +}; + ADDON = true;