diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index 2daffb3480..3cd598419e 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -177,7 +177,7 @@ switch (toLower _mode) do { } else { GVAR(camZoom) = (GVAR(camZoom) - (_zChange * GVAR(camZoom) * 0.2)) max 0.1; }; - call FUNC(handleCamera); + [] call FUNC(handleCamera); }; case "onmousemoving": { private ["_x","_y"]; @@ -185,7 +185,7 @@ switch (toLower _mode) do { _y = _args select 2; GVAR(mousePos) = [_x,_y]; - call FUNC(handleMouse); + [] call FUNC(handleMouse); }; // Keyboard events case "onkeydown": { diff --git a/addons/spectator/functions/fnc_handleKilled.sqf b/addons/spectator/functions/fnc_handleKilled.sqf index a69cce79f9..bea6db537f 100644 --- a/addons/spectator/functions/fnc_handleKilled.sqf +++ b/addons/spectator/functions/fnc_handleKilled.sqf @@ -20,3 +20,6 @@ _killer = _this select 1; // Remove from group to prevent appearing on HUD upon respawn [_unit, true, QGVAR(isSpectator), side group _unit] call EFUNC(common,switchToGroupSide); + +GVAR(camUnit) = _killer; +GVAR(camMode) = 2; diff --git a/addons/spectator/functions/fnc_handleRespawn.sqf b/addons/spectator/functions/fnc_handleRespawn.sqf index 20601567d7..6fc14b7fce 100644 --- a/addons/spectator/functions/fnc_handleRespawn.sqf +++ b/addons/spectator/functions/fnc_handleRespawn.sqf @@ -1,6 +1,6 @@ /* * Author: SilentSpike - * Start the spectator camera spectator on respawn + * Start the interface on respawn * * Arguments: * 0: New unit diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf index b77e6a920e..e6cb445072 100644 --- a/addons/spectator/functions/fnc_setSpectator.sqf +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -18,10 +18,7 @@ #include "script_component.hpp" -private ["_unit","_set","_target"]; -_unit = _this select 0; -_set = if (count _this > 1) then {_this select 1} else {true}; -_target = if (count _this > 2) then {_this select 2} else {objNull}; +params ["_unit",["_set",true,[true]],["_target",objNull,[objNull]]]; // No change, no service (but allow spectators who respawn to be reset) if !(_set || (_unit getVariable [QGVAR(isSpectator), false])) exitWith {}; @@ -47,10 +44,9 @@ if (_set) then { [_unit, QGVAR(isSpectator)] call EFUNC(common,hideUnit); [_unit, QGVAR(isSpectator)] call EFUNC(common,muteUnit); - if !(GVAR(modulePos)) then { - if !(isNull _target) then { - GVAR(camPos) = getPosATL _target; - }; + if !(isNull _target) then { + GVAR(camPos) = getPosASL _target; + GVAR(camUnit) = _target; }; ["open"] call FUNC(handleInterface); diff --git a/addons/spectator/functions/fnc_updateUnits.sqf b/addons/spectator/functions/fnc_updateUnits.sqf index 50d0811e58..1fb29eb6a5 100644 --- a/addons/spectator/functions/fnc_updateUnits.sqf +++ b/addons/spectator/functions/fnc_updateUnits.sqf @@ -18,9 +18,7 @@ #include "script_component.hpp" -_newUnits = _this select 0; -_append = if (count _this > 1) then {_this select 1} else {true}; -_permanent = if (count _this > 2) then {_this select 2} else {false}; +params [["_newUnits",[]],["_append",true,[true]],["_permanent",false,[false]]]; if (_permanent) then { if (_append) then {