diff --git a/addons/spectator/XEH_preInit.sqf b/addons/spectator/XEH_preInit.sqf index 2cc65602cc..a77d731478 100644 --- a/addons/spectator/XEH_preInit.sqf +++ b/addons/spectator/XEH_preInit.sqf @@ -38,6 +38,8 @@ GVAR(camUnit) = objNull; GVAR(camVision) = -2; GVAR(camZoom) = 1.25; +SETUVAR(GVAR(display),nil); + GVAR(showComp) = true; GVAR(showHelp) = true; GVAR(showIcons) = true; diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index 709c0263b2..2fa0d1439c 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -95,9 +95,7 @@ switch (toLower _mode) do { case "onload": { _args params ["_display"]; - with uiNamespace do { - GVAR(display) = _display; - }; + SETUVAR(GVAR(display),_display); // Always show interface and hide map upon opening [_display,nil,nil,!GVAR(showInterface),GVAR(showMap)] call FUNC(toggleInterface); @@ -151,9 +149,7 @@ switch (toLower _mode) do { //_display displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; }; case "onunload": { - with uiNamespace do { - GVAR(display) = nil; - }; + SETUVAR(GVAR(display),nil); GVAR(camHandler) = nil; GVAR(compHandler) = nil;