mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Medical - Rename private version of setUnconscious (#7237)
This commit is contained in:
parent
8c7f8d7d6a
commit
9ac543aacc
@ -43,7 +43,7 @@ class ACE_Medical_StateMachine {
|
||||
};
|
||||
class Unconscious {
|
||||
onState = QFUNC(handleStateUnconscious);
|
||||
onStateEntered = QUOTE([ARR_2(_this,true)] call EFUNC(medical_status,setUnconscious));
|
||||
onStateEntered = QUOTE([ARR_2(_this,true)] call EFUNC(medical_status,setUnconsciousState));
|
||||
class DeathAI {
|
||||
targetState = "Dead";
|
||||
condition = QUOTE(!GVAR(AIUnconsciousness) && {!isPlayer _this});
|
||||
@ -52,7 +52,7 @@ class ACE_Medical_StateMachine {
|
||||
targetState = "Injured";
|
||||
condition = QEFUNC(medical_status,hasStableVitals);
|
||||
events[] = {QEGVAR(medical,WakeUp)};
|
||||
onTransition = QUOTE([ARR_2(_this,false)] call EFUNC(medical_status,setUnconscious));
|
||||
onTransition = QUOTE([ARR_2(_this,false)] call EFUNC(medical_status,setUnconsciousState));
|
||||
};
|
||||
class FatalTransitions {
|
||||
targetState = "CardiacArrest";
|
||||
|
@ -28,4 +28,4 @@ _unit setVariable [QGVAR(cardiacArrestTimeLastUpdate), CBA_missionTime];
|
||||
TRACE_3("enteredStateCardiacArrest",_unit,_time,CBA_missionTime);
|
||||
|
||||
// Update the unit status to reflect cardiac arrest
|
||||
[_unit, true] call EFUNC(medical_status,setCardiacArrest);
|
||||
[_unit, true] call EFUNC(medical_status,setCardiacArrestState);
|
||||
|
@ -22,4 +22,4 @@ TRACE_1("leftStateCardiacArrest",_unit);
|
||||
_unit setVariable [QGVAR(cardiacArrestTimeLeft), nil];
|
||||
_unit setVariable [QGVAR(cardiacArrestTimeLastUpdate), nil];
|
||||
|
||||
[_unit, false] call EFUNC(medical_status,setCardiacArrest);
|
||||
[_unit, false] call EFUNC(medical_status,setCardiacArrestState);
|
||||
|
@ -29,14 +29,14 @@ if (_isLocal) then {
|
||||
switch (true) do {
|
||||
case (IN_CRDC_ARRST(_unit)): {
|
||||
if (_currentState == "CardiacArrest") exitWith {};
|
||||
_unit setVariable [VAR_CRDC_ARRST, false]; // force reset vars so setCardiacArrest can run (enteredStateCardiacArrest will also be called)
|
||||
_unit setVariable [VAR_CRDC_ARRST, false]; // force reset vars so setCardiacArrestState can run (enteredStateCardiacArrest will also be called)
|
||||
_unit setVariable [VAR_UNCON, false];
|
||||
TRACE_1("manually changing state to CardiacArrest",_currentState);
|
||||
[_unit, EGVAR(medical,STATE_MACHINE), _currentState, "CardiacArrest", {}, "LocalityChange"] call CBA_statemachine_fnc_manualTransition;
|
||||
};
|
||||
case (IS_UNCONSCIOUS(_unit)): {
|
||||
if (_currentState == "Unconscious") exitWith {};
|
||||
_unit setVariable [VAR_UNCON, false]; // force reset var so ace_medical_status_fnc_setUnconscious can run
|
||||
_unit setVariable [VAR_UNCON, false]; // force reset var so ace_medical_status_fnc_setUnconsciousState can run
|
||||
TRACE_1("manually changing state to Unconscious",_currentState);
|
||||
[_unit, EGVAR(medical,STATE_MACHINE), _currentState, "Unconscious", {}, "LocalityChange"] call CBA_statemachine_fnc_manualTransition;
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ PREP(initUnit);
|
||||
PREP(isBeingCarried);
|
||||
PREP(isBeingDragged);
|
||||
PREP(isInStableCondition);
|
||||
PREP(setCardiacArrest);
|
||||
PREP(setCardiacArrestState);
|
||||
PREP(setDead);
|
||||
PREP(setUnconscious);
|
||||
PREP(setUnconsciousState);
|
||||
PREP(updateWoundBloodLoss);
|
||||
|
@ -13,13 +13,13 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [player, true] call ace_medical_status_fnc_setCardiacArrest
|
||||
* [player, true] call ace_medical_status_fnc_setCardiacArrestState
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit", "_active"];
|
||||
TRACE_2("setCardiacArrest",_unit,_active);
|
||||
TRACE_2("setCardiacArrestState",_unit,_active);
|
||||
|
||||
// No change to make
|
||||
if (_active isEqualTo IN_CRDC_ARRST(_unit)) exitWith { TRACE_2("no change",_active,IN_CRDC_ARRST(_unit)); };
|
||||
@ -29,6 +29,6 @@ _unit setVariable [VAR_CRDC_ARRST, _active, true];
|
||||
_unit setVariable [VAR_HEART_RATE, [40, 0] select _active, true];
|
||||
|
||||
// Cardiac arrest is an extension of unconsciousness
|
||||
[_unit, _active] call FUNC(setUnconscious);
|
||||
[_unit, _active] call FUNC(setUnconsciousState);
|
||||
|
||||
["ace_cardiacArrest", [_unit, _active]] call CBA_fnc_localEvent;
|
@ -12,13 +12,13 @@
|
||||
* Success <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player, true] call ace_medical_status_fnc_setUnconscious
|
||||
* [player, true] call ace_medical_status_fnc_setUnconsciousState
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit", "_active"];
|
||||
TRACE_2("setUnconscious",_unit,_active);
|
||||
TRACE_2("setUnconsciousState",_unit,_active);
|
||||
|
||||
// No change to make
|
||||
if (_active isEqualTo IS_UNCONSCIOUS(_unit)) exitWith { TRACE_2("no change",_active,IS_UNCONSCIOUS(_unit)); };
|
Loading…
Reference in New Issue
Block a user