Fixed instant death and PREP

This commit is contained in:
BaerMitUmlaut 2016-11-07 23:46:10 +01:00
parent ba9fc9240c
commit 928ded0e66
3 changed files with 25 additions and 3 deletions

View File

@ -62,12 +62,15 @@ class ACE_Medical_StateMachine {
};
class FatalInjury {
// Transition state for handling instant death
// This state raises the next transition in the same frame
onStateEntered = QUOTE(DFUNC(enteredStateFatalInjury));
class InstantDeathPrevented {
events[] = {QGVAR(FatalInjuryInstantTransition)};
targetState = "CardiacArrest";
condition = QUOTE(DFUNC(conditionPreventInstantDeath));
condition = QUOTE(!GVAR(enableInstantDeath));
};
class InstantDeath {
events[] = {QGVAR(FatalInjuryInstantTransition)};
targetState = "Dead";
condition = "true";
};

View File

@ -1,4 +1,3 @@
PREP(adjustPainLevel);
PREP(getBloodLoss);
PREP(getBloodPressure);
@ -15,12 +14,16 @@ PREP(isMedicalVehicle);
// PREP(hasMedicalEnabled);
PREP(enteredStateCardiacArrest);
PREP(leavingStateCardiacArrest);
PREP(enteredStateFatalInjury);
PREP(handleStateDefault);
PREP(handleStateInjured);
PREP(handleStateUnconscious);
PREP(handleUnitVitals);
PREP(handleMedications);
// PREP(handleStateRevive);
PREP(addPain);
PREP(setUnconscious);

View File

@ -0,0 +1,16 @@
/*
* Author: BaerMitUmlaut
* Raises the transition to the next state instantly when fatally injured.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
[QGVAR(FatalInjuryInstantTransition), _unit] call CBA_fnc_localEvent;