2018-09-17 19:19:29 +00:00
|
|
|
#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-01-12 10:24:58 +00:00
|
|
|
|
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 {
|
2016-05-14 08:49:09 +00:00
|
|
|
[
|
|
|
|
_unit,
|
|
|
|
_unit getVariable QGVAR(unitGear),
|
|
|
|
_unit getVariable QGVAR(activeWeaponAndMuzzle)
|
|
|
|
] call FUNC(restoreGear);
|
2015-01-12 09:07:03 +00:00
|
|
|
};
|
2015-04-15 06:31:40 +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];
|
2015-04-15 06:31:40 +00:00
|
|
|
};
|