From 091c807708e621b88029341cf131f73a6dadda55 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Jan 2016 00:30:03 -0600 Subject: [PATCH] Restart specatator display if player in unitList Possible fix for #2677 --- addons/spectator/functions/fnc_stageSpectator.sqf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/spectator/functions/fnc_stageSpectator.sqf b/addons/spectator/functions/fnc_stageSpectator.sqf index 87b2faffa8..926ac008dc 100644 --- a/addons/spectator/functions/fnc_stageSpectator.sqf +++ b/addons/spectator/functions/fnc_stageSpectator.sqf @@ -66,3 +66,13 @@ if !(_set isEqualTo (GETVAR(_unit,GVAR(isStaged),false))) then { ["spectatorStaged",[_set]] call EFUNC(common,localEvent); }; + +//BandAid for #2677 - if player in unitList weird before being staged, weird things can happen +if ((player in GVAR(unitList)) || {ACE_player in GVAR(unitList)}) then { + [] call FUNC(updateUnits); //update list now + if (!(isNull (findDisplay 12249))) then {//If display is open now, close it and restart + ACE_LOGWARNING("Player in unitList, call ace_spectator_fnc_stageSpectator before ace_spectator_fnc_setSpectator"); + ["fixWeirdList", true] call FUNC(interrupt); + [{["fixWeirdList", false] call FUNC(interrupt);}, []] call EFUNC(common,execNextFrame); + }; +};