ACE3/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf

29 lines
860 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: SilentSpike
* Handles a unit reaching the point of death (calls for a status update).
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* None
*
2019-03-30 16:07:54 +00:00
* Example:
* [player] call ace_medical_statemachine_fnc_enteredStateDeath
*
* Public: No
*/
params ["_unit"];
if (isNull _unit) exitWith {};
//IGNORE_PRIVATE_WARNING ["_thisOrigin", "_thisTransition"]; // vars provided by CBA_statemachine
TRACE_3("enteredStateDeath",_this,_thisOrigin,_thisTransition);
private _causeOfDeath = format ["%1:%2", _thisOrigin, _thisTransition];
private _instigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull];
// could delay a frame here to fix the double killed EH, but we lose it being a "native" kill (scoreboard / rating)
[_unit, _causeOfDeath, _instigator] call EFUNC(medical_status,setDead);