ACE3/addons/medical_statemachine/functions/fnc_enteredStateFatalInjury.sqf
GhostIsSpooky 9209fedcf7
Medical Statemachine - Improve edge case death handling (#8788)
* fix #8772

* add WARNING for dead/null units

* fix macro

* improve warnings

* handle scripted death without warnings

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2022-03-07 12:28:51 -06:00

24 lines
594 B
Plaintext

#include "script_component.hpp"
/*
* Author: BaerMitUmlaut
* Raises the transition to the next state instantly when fatally injured.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call ace_medical_statemachine_fnc_enteredStateFatalInjury
*
* Public: No
*/
params ["_unit"];
if (isNull _unit || {!isNil {_unit getVariable QEGVAR(medical,causeOfDeath)}}) exitWith {
WARNING_1("enteredStateFatalInjury: State transition on dead or null unit - %1",_unit);
};
[QEGVAR(medical,FatalInjuryInstantTransition), _unit] call CBA_fnc_localEvent;