From 98e9245ed9efaff7328bcfa092628da4f8ac58f7 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 5 Jul 2015 21:53:09 +0100 Subject: [PATCH] Basic respawning support --- addons/spectator/functions/fnc_handleRespawn.sqf | 4 ++-- addons/spectator/functions/fnc_setSpectator.sqf | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/spectator/functions/fnc_handleRespawn.sqf b/addons/spectator/functions/fnc_handleRespawn.sqf index 6a8e9eb84a..b750439b42 100644 --- a/addons/spectator/functions/fnc_handleRespawn.sqf +++ b/addons/spectator/functions/fnc_handleRespawn.sqf @@ -3,8 +3,8 @@ * Start the spectator camera spectator on respawn * * Arguments: - * 0: Corpse - * 1: Killer + * 0: New unit + * 1: Old unit * * Return Value: * None diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf index 070994013f..a7729147c8 100644 --- a/addons/spectator/functions/fnc_setSpectator.sqf +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -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