Merge pull request #3147 from acemod/spectatorBandAid

Restart specatator display if player in unitList
This commit is contained in:
SilentSpike 2016-01-19 20:15:24 +00:00
commit ca5f6df3d0

View File

@ -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);
};
};