Basic respawning support

This commit is contained in:
SilentSpike 2015-07-05 21:53:09 +01:00
parent 2aebabdb2c
commit 98e9245ed9
2 changed files with 7 additions and 3 deletions

View File

@ -3,8 +3,8 @@
* Start the spectator camera spectator on respawn
*
* Arguments:
* 0: Corpse <OBJECT>
* 1: Killer <OBJECT>
* 0: New unit <OBJECT>
* 1: Old unit <OBJECT>
*
* Return Value:
* None <NIL>

View File

@ -17,6 +17,7 @@
#include "script_component.hpp"
private ["_unit","_target","_set"];
_unit = player;
_target = _this select 0;
_set = if (count _this > 1) then {_this select 1} else {true};
@ -44,7 +45,6 @@ if (_set) then {
["Init", [true]] call FUNC(camera);
} else {
// Code to exit spectator and "respawn" player goes here (WIP)
["Exit"] call FUNC(camera);
// Physical beings can talk
@ -57,6 +57,10 @@ if (_set) then {
} else {
[_unit] joinSilent GVAR(cachedGroup);
};
private ["_marker"];
_marker = ["respawn_west","respawn_east","respawn_guerrila","respawn_civilian"] select ([west,east,resistance,civilian] find GVAR(cachedSide));
_unit setPos (getMarkerPos _marker);
};
// Handle common addon audio