Restart specatator display if player in unitList

Possible fix for #2677
This commit is contained in:
PabstMirror 2016-01-12 00:30:03 -06:00
parent 8cbf31a375
commit 091c807708

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