From 78e17c4bdcd82b8639779924e23e140500b484e5 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Thu, 16 Jul 2015 21:37:20 +0100 Subject: [PATCH] Fix function calls with switch to params --- addons/spectator/functions/fnc_handleCamera.sqf | 2 +- .../spectator/functions/fnc_handleInterface.sqf | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/addons/spectator/functions/fnc_handleCamera.sqf b/addons/spectator/functions/fnc_handleCamera.sqf index 66498b002e..20453d4cb0 100644 --- a/addons/spectator/functions/fnc_handleCamera.sqf +++ b/addons/spectator/functions/fnc_handleCamera.sqf @@ -65,7 +65,7 @@ switch (GVAR(camMode)) do { {vehicle GVAR(camUnit) == GVAR(camUnit)} && {GVAR(camUnit) in GVAR(unitList)} ) then { - call FUNC(updateView); + [] call FUNC(updateView); }; }; }; diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index 06e569346a..fe361a8e7f 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -58,7 +58,7 @@ switch (toLower _mode) do { // Initalize the camera view GVAR(camera) = "Camera" camCreate GVAR(camPos); GVAR(camera) setDir GVAR(camPan); - call FUNC(updateView); + [] call FUNC(updateView); // Handle camera movement [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; @@ -156,7 +156,7 @@ switch (toLower _mode) do { if ((_button == 1) && (GVAR(camMode) == 1)) then { // In first person toggle sights mode GVAR(gunCam) = !GVAR(gunCam); - call FUNC(updateView); + [] call FUNC(updateView); }; }; case "onmousebuttonup": { @@ -284,15 +284,11 @@ switch (toLower _mode) do { _netID = (_args select 0) tvData _sel; _newUnit = objectFromNetId _netID; - // Only update camera mode when in free cam - if (GVAR(camMode) == 0) then { - _newMode = 1; - } else { - // When unit is reselected, toggle camera mode - if (_newUnit == GVAR(camUnit)) then { - _newMode = [0,2,1] select GVAR(camMode); - }; + // When unit is reselected, toggle camera mode + if (_newUnit == GVAR(camUnit) || GVAR(camMode) == 0) then { + _newMode = [1,2,1] select GVAR(camMode); }; + GVAR(camUnit) = _newUnit; [_newMode] call FUNC(updateView); };