From f7cf983e926acb40f873dd22c402d8bfde4291b8 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 18 Jul 2015 18:25:59 +0100 Subject: [PATCH] Corrected current unit updating --- addons/spectator/functions/fnc_handleUnits.sqf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/spectator/functions/fnc_handleUnits.sqf b/addons/spectator/functions/fnc_handleUnits.sqf index abb0c70736..5227e49eaf 100644 --- a/addons/spectator/functions/fnc_handleUnits.sqf +++ b/addons/spectator/functions/fnc_handleUnits.sqf @@ -23,6 +23,11 @@ if (isNull (GETUVAR(GVAR(display),displayNull))) exitWith { [_this select 1] cal GVAR(unitList) = GVAR(unitList) - allDead; GVAR(unitList) = GVAR(unitList) - [objNull]; +// Camera shouldn't stay on unit that isn't in the list +if !(GVAR(camUnit) in GVAR(unitList)) then { + [0,objNull] call FUNC(updateCamera); +}; + // Fetch tree disableSerialization; _display = GETUVAR(GVAR(display),displayNull); @@ -66,9 +71,5 @@ _cachedGrps = []; _ctrl tvExpand [_node]; } forEach GVAR(unitList); -if ((tvCurSel _ctrl) isEqualTo []) then { - [0,objNull] call FUNC(updateCamera); -}; - // Sort group nodes by side _ctrl tvSortByValue [[],false];