From 9ac543aacc541cc094b237cc82d6ed3cb6a567bc Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 12 Oct 2019 09:47:57 -0500 Subject: [PATCH] Medical - Rename private version of setUnconscious (#7237) --- addons/medical_statemachine/Statemachine.hpp | 4 ++-- .../functions/fnc_enteredStateCardiacArrest.sqf | 2 +- .../functions/fnc_leftStateCardiacArrest.sqf | 2 +- .../functions/fnc_localityChangedEH.sqf | 4 ++-- addons/medical_status/XEH_PREP.hpp | 4 ++-- ...c_setCardiacArrest.sqf => fnc_setCardiacArrestState.sqf} | 6 +++--- .../{fnc_setUnconscious.sqf => fnc_setUnconsciousState.sqf} | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) rename addons/medical_status/functions/{fnc_setCardiacArrest.sqf => fnc_setCardiacArrestState.sqf} (84%) rename addons/medical_status/functions/{fnc_setUnconscious.sqf => fnc_setUnconsciousState.sqf} (94%) diff --git a/addons/medical_statemachine/Statemachine.hpp b/addons/medical_statemachine/Statemachine.hpp index efeede18dd..17a4baaf07 100644 --- a/addons/medical_statemachine/Statemachine.hpp +++ b/addons/medical_statemachine/Statemachine.hpp @@ -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"; diff --git a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf index 0c5e184029..b2bcde8071 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf @@ -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); diff --git a/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf b/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf index 5b077be771..2f0793f7c7 100644 --- a/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf +++ b/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf @@ -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); diff --git a/addons/medical_statemachine/functions/fnc_localityChangedEH.sqf b/addons/medical_statemachine/functions/fnc_localityChangedEH.sqf index e76784a939..9e5fb3c9b5 100644 --- a/addons/medical_statemachine/functions/fnc_localityChangedEH.sqf +++ b/addons/medical_statemachine/functions/fnc_localityChangedEH.sqf @@ -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; }; diff --git a/addons/medical_status/XEH_PREP.hpp b/addons/medical_status/XEH_PREP.hpp index 5d5f2f464c..11fae9e2e6 100644 --- a/addons/medical_status/XEH_PREP.hpp +++ b/addons/medical_status/XEH_PREP.hpp @@ -11,7 +11,7 @@ PREP(initUnit); PREP(isBeingCarried); PREP(isBeingDragged); PREP(isInStableCondition); -PREP(setCardiacArrest); +PREP(setCardiacArrestState); PREP(setDead); -PREP(setUnconscious); +PREP(setUnconsciousState); PREP(updateWoundBloodLoss); diff --git a/addons/medical_status/functions/fnc_setCardiacArrest.sqf b/addons/medical_status/functions/fnc_setCardiacArrestState.sqf similarity index 84% rename from addons/medical_status/functions/fnc_setCardiacArrest.sqf rename to addons/medical_status/functions/fnc_setCardiacArrestState.sqf index e79d09d28b..2dd54c9c4d 100644 --- a/addons/medical_status/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical_status/functions/fnc_setCardiacArrestState.sqf @@ -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; diff --git a/addons/medical_status/functions/fnc_setUnconscious.sqf b/addons/medical_status/functions/fnc_setUnconsciousState.sqf similarity index 94% rename from addons/medical_status/functions/fnc_setUnconscious.sqf rename to addons/medical_status/functions/fnc_setUnconsciousState.sqf index ca53f85a88..88a37927d9 100644 --- a/addons/medical_status/functions/fnc_setUnconscious.sqf +++ b/addons/medical_status/functions/fnc_setUnconsciousState.sqf @@ -12,13 +12,13 @@ * Success * * 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)); };