From c8e6e7018c1427de2ba07929e5ca71d0214d299a Mon Sep 17 00:00:00 2001 From: Nou Date: Sat, 25 Apr 2015 00:49:47 -0700 Subject: [PATCH] Moved infinite spawned loop to Loaded event for handing save game loads. Events for the win! diag_activeSQFScripts as of this build returns empty on a bare mission. --- addons/common/XEH_postInit.sqf | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 3a16ac9d43..a06792a75d 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -97,14 +97,16 @@ if (!hasInterface) exitWith {}; call COMPILE_FILE(scripts\assignedItemFix); call COMPILE_FILE(scripts\initScrollWheel); -0 spawn { - while {true} do { - waitUntil {!isNull (findDisplay 46)}; sleep 0.1; - findDisplay 46 displayAddEventHandler ["MouseZChanged", QUOTE( _this call GVAR(onScrollWheel) )]; - [false] call FUNC(disableUserInput); - waitUntil {isNull (findDisplay 46)}; - }; +DFUNC(mouseZHandler) = { + waitUntil {!isNull (findDisplay 46)}; sleep 0.1; + findDisplay 46 displayAddEventHandler ["MouseZChanged", QUOTE( _this call GVAR(onScrollWheel) )]; + [false] call FUNC(disableUserInput); }; + +addMissionEventHandler ["Loaded", FUNC(mouseZHandler)]; +[] spawn FUNC(mouseZHandler); + + enableCamShake true; // Set the name for the current player