ACE3/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf
PabstMirror d6c39e661f
Medical StateMachine - Tweak dead state handling (#7061)
* Medical StateMachine - Tweak dead state handling

- Don't call setDammage inside HandleDamage EH
- Add death reason on entering death state

* add a getVar disable in case this causes problems

* Cleanup

* cleanup

* Update addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf

Co-Authored-By: Ferran Obon <magnetar5891@gmail.com>
2019-09-05 15:56:14 -05:00

28 lines
764 B
Plaintext

#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
*
* 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];
// could delay a frame here to fix the double killed EH, but we lose it being a "native" kill (scoreboard / rating)
[_unit, _causeOfDeath] call EFUNC(medical_status,setDead);