2016-10-12 21:20:22 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Kills a local unit.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The unit <OBJECT>
|
|
|
|
* 1: Reason for death <STRING>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
2016-10-12 21:20:22 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [bob, "bloodloss"] call ace_medical_fnc_setDead;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params ["_unit", ["_reason", "unknown"]];
|
|
|
|
|
2016-10-13 18:17:21 +00:00
|
|
|
// wait a frame to escape handleDamage
|
2017-04-27 16:53:06 +00:00
|
|
|
// @TODO Test if this is still necessary
|
2016-10-13 18:17:21 +00:00
|
|
|
[EFUNC(medical_engine,setStructuralDamage), [_unit, 1]] call CBA_fnc_execNextFrame;
|
2016-10-12 21:20:22 +00:00
|
|
|
|
|
|
|
private _lastShooter = _unit getVariable [QEGVAR(medical_engine,lastShooter), objNull];
|
|
|
|
private _lastInstigator = _unit getVariable [QEGVAR(medical_engine,lastInstigator), objNull];
|
|
|
|
|
|
|
|
["ace_killed", [_unit, _reason, _lastShooter, _lastInstigator]] call CBA_fnc_globalEvent;
|