2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-08-12 13:25:48 +00:00
|
|
|
/*
|
2023-08-17 10:02:17 +00:00
|
|
|
* Author: kymckay
|
2017-08-12 13:25:48 +00:00
|
|
|
* Handles "compatibility" (i.e. override) for BI spectator respawn types 1, 4 & 5
|
|
|
|
*
|
|
|
|
* Called from the RscDisplayEGSpectator XEH
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: RscDisplayEGSpectator <DISPLAY>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* _this call ace_spectator_fnc_compat_spectatorBI
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
private _respawn = getMissionConfigValue ["respawn",0];
|
2024-03-07 21:08:13 +00:00
|
|
|
if (_respawn isEqualType "") then { _respawn = ["","bird","","","group","side"] find (toLowerANSI _respawn); };
|
2017-08-12 13:25:48 +00:00
|
|
|
if !(_respawn in [1,4,5]) exitWith {};
|
|
|
|
|
|
|
|
// Remember to check for side specific templates
|
|
|
|
private _templates = getMissionConfigValue [["respawnTemplates",side group player] joinString "",getMissionConfigValue ["respawnTemplates",[]]];
|
|
|
|
if !(QUOTE(ADDON) in _templates) exitWith {};
|
|
|
|
|
|
|
|
// Kill BI spectator
|
|
|
|
["Terminate"] call BIS_fnc_EGSpectator;
|
|
|
|
|
|
|
|
// Start our spectator
|
|
|
|
[true] call FUNC(setSpectator);
|
|
|
|
|
|
|
|
// Delete the seagull that spawns (not actually the player, a CfgNonAIVehicles object)
|
|
|
|
// Respawn type 1 is handled in the template where seagull is passed as paremeter
|
|
|
|
if (_respawn in [4,5]) then {
|
|
|
|
// This could delete seagulls created by a wildlife module (a necessary evil)
|
|
|
|
// TODO: Try to find seagull position and delete more accurately with reduced radius
|
|
|
|
{ if (_x isKindOf "seagull") then {deleteVehicle _x;}; } forEach (nearestObjects [player, [], 250]);
|
|
|
|
};
|
|
|
|
|
|
|
|
// Switch to a virtual unit so draw3D continues to work
|
|
|
|
private _grp = createGroup [sideLogic, true];
|
2017-12-01 16:34:27 +00:00
|
|
|
private _virtual = _grp createUnit [QGVAR(virtual),[0,0,0],[],0,"NONE"];
|
2017-08-12 13:25:48 +00:00
|
|
|
|
2017-11-30 22:51:34 +00:00
|
|
|
// Prevent unit falling into water (compatibility for some addons)
|
|
|
|
_virtual enableSimulation false;
|
|
|
|
|
2017-08-12 13:25:48 +00:00
|
|
|
// Transfer assigned zeus if applicable
|
|
|
|
private _zeus = getAssignedCuratorLogic player;
|
|
|
|
if !(isNull _zeus) then {
|
|
|
|
[QGVAR(transferZeus), [_virtual,_zeus]] call CBA_fnc_serverEvent;
|
|
|
|
};
|
|
|
|
|
|
|
|
selectPlayer _virtual;
|