ACE3/addons/respawn/functions/fnc_handleRespawn.sqf

34 lines
778 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-01-12 09:07:03 +00:00
/*
2015-09-26 14:26:41 +00:00
* Author: bux578
* Handles the XEH Respawn event.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Corpse <OBJECT>
*
* Return Value:
* None
*
* Example:
* [ACE_Player, old_body_lying_on_floor] call ace_respawn_fnc_handleRespawn
*
* Public: No
*/
2015-09-26 14:26:41 +00:00
params ["_unit"];
2015-01-12 09:07:03 +00:00
// Restores the gear when the player respawns
2015-01-12 09:49:21 +00:00
if (GVAR(SavePreDeathGear)) then {
[
_unit,
_unit getVariable QGVAR(unitGear),
_unit getVariable QGVAR(activeWeaponAndMuzzle)
] call FUNC(restoreGear);
2015-01-12 09:07:03 +00:00
};
// fix for setVariable public being lost on respawn for machines that JIP after the command was broadcasted
2015-09-26 14:26:41 +00:00
if (_unit getVariable ["ACE_canMoveRallypoint", false]) then {
_unit setVariable ["ACE_canMoveRallypoint", true, true];
};