ACE3/addons/medical_status/functions/fnc_setDead.sqf
PabstMirror 0d7709673a
Medical Feedback - Fix DISABLE_VANILLA_DAMAGE_EFFECTS (#6966)
* Medical Feedback - Fix DISABLE_VANILLA_DAMAGE_EFFECTS

* Keep compatibilty with old ace_medical_lastDamageSource var name
2019-04-27 14:04:31 -05:00

29 lines
770 B
Plaintext

#include "script_component.hpp"
/*
* Author: commy2
* Kills a local unit.
*
* Arguments:
* 0: The unit <OBJECT>
* 1: Reason for death <STRING>
*
* Return Value:
* None
*
* Public: No
*/
params ["_unit", ["_reason", "unknown"]];
// No heart rate or blood pressure to measure when dead
_unit setVariable [VAR_HEART_RATE, 0, true];
_unit setVariable [VAR_BLOOD_PRESS, [0, 0], true];
// Kill the unit without changing visual apperance
[_unit, 1] call EFUNC(medical_engine,setStructuralDamage);
private _lastShooter = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull];
private _lastInstigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull];
["ace_killed", [_unit, _reason, _lastShooter, _lastInstigator]] call CBA_fnc_globalEvent;