From 52460182c9c662dacc76e27f21a5d9e8b37786e8 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 2 Aug 2015 16:42:24 +0100 Subject: [PATCH] Enable spectator on death system New spectator on death system should enter spectator mode upon dying and exit upon respawning. Only virtual spectator state is suitable for this system since the body should remain as is. --- addons/spectator/functions/fnc_handleKilled.sqf | 9 ++++----- addons/spectator/functions/fnc_handleRespawn.sqf | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/spectator/functions/fnc_handleKilled.sqf b/addons/spectator/functions/fnc_handleKilled.sqf index 67c556cc3f..05671ed749 100644 --- a/addons/spectator/functions/fnc_handleKilled.sqf +++ b/addons/spectator/functions/fnc_handleKilled.sqf @@ -1,7 +1,7 @@ /* * Author: SilentSpike - * Cache necessary details and process unit for spectator on death - * Part of the basic spectator system + * Set inital camera attributes and set as spectator on death + * Part of the spectator during death system * * Arguments: * 0: Corpse @@ -17,11 +17,10 @@ params ["_unit","_killer"]; -// Remove from group to prevent appearing on HUD upon respawn -[_unit, true, QGVAR(isSpectator), side group _unit] call EFUNC(common,switchToGroupSide); - if (isNull _killer) then { [2,_unit] call FUNC(setCameraAttributes); } else { [2,_killer] call FUNC(setCameraAttributes); }; + +[_unit] call FUNC(setSpectator); diff --git a/addons/spectator/functions/fnc_handleRespawn.sqf b/addons/spectator/functions/fnc_handleRespawn.sqf index 9b6b0bb802..3e7dfa41f3 100644 --- a/addons/spectator/functions/fnc_handleRespawn.sqf +++ b/addons/spectator/functions/fnc_handleRespawn.sqf @@ -1,7 +1,7 @@ /* * Author: SilentSpike - * Start the interface on respawn - * Part of the basic spectator system + * Un-set as spectator on respawn + * Part of the spectator during death system * * Arguments: * 0: New unit @@ -15,4 +15,4 @@ #include "script_component.hpp" -[_this select 0] call FUNC(setSpectator); +[_unit,false] call FUNC(setSpectator);