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