Medical - Rename private version of setUnconscious (#7237)

This commit is contained in:
PabstMirror 2019-10-12 09:47:57 -05:00 committed by GitHub
parent 8c7f8d7d6a
commit 9ac543aacc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 13 deletions

View File

@ -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";

View File

@ -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);

View File

@ -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);

View File

@ -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;
};

View File

@ -11,7 +11,7 @@ PREP(initUnit);
PREP(isBeingCarried);
PREP(isBeingDragged);
PREP(isInStableCondition);
PREP(setCardiacArrest);
PREP(setCardiacArrestState);
PREP(setDead);
PREP(setUnconscious);
PREP(setUnconsciousState);
PREP(updateWoundBloodLoss);

View File

@ -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;

View File

@ -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)); };