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.
This commit is contained in:
SilentSpike 2015-08-02 16:42:24 +01:00
parent 63c034e348
commit 52460182c9
2 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,7 @@
/* /*
* Author: SilentSpike * Author: SilentSpike
* Cache necessary details and process unit for spectator on death * Set inital camera attributes and set as spectator on death
* Part of the basic spectator system * Part of the spectator during death system
* *
* Arguments: * Arguments:
* 0: Corpse <OBJECT> * 0: Corpse <OBJECT>
@ -17,11 +17,10 @@
params ["_unit","_killer"]; 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 { if (isNull _killer) then {
[2,_unit] call FUNC(setCameraAttributes); [2,_unit] call FUNC(setCameraAttributes);
} else { } else {
[2,_killer] call FUNC(setCameraAttributes); [2,_killer] call FUNC(setCameraAttributes);
}; };
[_unit] call FUNC(setSpectator);

View File

@ -1,7 +1,7 @@
/* /*
* Author: SilentSpike * Author: SilentSpike
* Start the interface on respawn * Un-set as spectator on respawn
* Part of the basic spectator system * Part of the spectator during death system
* *
* Arguments: * Arguments:
* 0: New unit <OBJECT> * 0: New unit <OBJECT>
@ -15,4 +15,4 @@
#include "script_component.hpp" #include "script_component.hpp"
[_this select 0] call FUNC(setSpectator); [_unit,false] call FUNC(setSpectator);