From 3d290977e5f403030ceb55c7336afe39bd220eda Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Wed, 22 Jul 2015 14:57:38 +0100 Subject: [PATCH] Preserve unit name in toolbar --- addons/spectator/functions/fnc_handleToolbar.sqf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/spectator/functions/fnc_handleToolbar.sqf b/addons/spectator/functions/fnc_handleToolbar.sqf index aed3941f5c..d6c9d8bf9d 100644 --- a/addons/spectator/functions/fnc_handleToolbar.sqf +++ b/addons/spectator/functions/fnc_handleToolbar.sqf @@ -35,15 +35,19 @@ _toolbar = _display displayCtrl IDC_TOOL; if (GVAR(camMode) == 0) then { _vision = if (GVAR(camVision) >= 0) then {localize LSTRING(VisionThermal)} else { [localize LSTRING(VisionNight), localize LSTRING(VisionNormal)] select (GVAR(camVision) < -1) }; _fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01]; - _name = localize "STR_VOICE_MASK_NONE"; _speed = format ["%1 m/s", floor(GVAR(camSpeed) * 100) * 0.01]; } else { _vision = format ["%1 m", floor(getPosASL GVAR(camUnit) select 2)]; _fov = WFSideText (group GVAR(camUnit)); - _name = name GVAR(camUnit); _speed = format ["%1 km/h", floor(speed GVAR(camUnit)) max 0]; }; +if (isNull GVAR(camUnit)) then { + _name = localize "STR_VOICE_MASK_NONE"; +} else { + _name = name GVAR(camUnit); +}; + _mode = [localize LSTRING(ViewFree),localize LSTRING(ViewInternal),localize LSTRING(ViewExternal)] select GVAR(camMode); _time = [daytime,"HH:MM"] call BIS_fnc_timeToString;