mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: SilentSpike
|
|
* The ace_spectator respawn template, compatible with types 1,2,3,4 & 5
|
|
*
|
|
* Handles killed and respawned events as per BI's respawn framework:
|
|
* https://community.bistudio.com/wiki/Arma_3_Respawn
|
|
*
|
|
* Arguments:
|
|
* 0: Corpse/New Unit <OBJECT>
|
|
* 1: Killer/Old Unit <OBJECT>
|
|
* 2: Respawn Type <NUMBER>
|
|
* 3: Respawn Delay <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [bob, kevin, 3, 6] call ace_spectator_fnc_respawnTemplate
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params [["_newCorpse",objNull,[objNull]], ["_oldKiller",objNull,[objNull]], ["_respawn",0,[0]], ["_respawnDelay",0,[0]]];
|
|
TRACE_4("respawnTemplate",_newCorpse,_oldKiller,_respawn,_respawnDelay);
|
|
|
|
// Compatibility handled via spectator display XEH
|
|
if (_respawn in [0,1,4,5]) exitWith {
|
|
// This only applies to respawn type 1 (BIRD/SPECTATOR)
|
|
// Remove the seagull (not actually the player, a CfgNonAIVehicles object)
|
|
if (typeOf _newCorpse == "seagull") then { deleteVehicle _newCorpse; };
|
|
};
|
|
|
|
// Virtual spectators should be ignored by the template (otherwise they break)
|
|
if (_newCorpse isKindOf QGVAR(virtual)) exitWith {};
|
|
|
|
// If player died while already in spectator, ignore
|
|
if (!GVAR(isSet) || {alive _newCorpse}) then {
|
|
// Negligible respawn delay can result in entering spectator after respawn
|
|
// So we just use this value rather than living state of the unit
|
|
[playerRespawnTime > 1] call FUNC(setSpectator);
|
|
};
|