diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf index 86ae38efb7..f721cbfb95 100644 --- a/addons/medical/functions/fnc_addDamageToUnit.sqf +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -41,14 +41,14 @@ if (!isNull _instigator) then { #ifdef DEBUG_TESTRESULTS private _startDmg = +(_unit getVariable [QGVAR(bodyPartDamage), [-1]]); -private _startPain = _unit getVariable [QGVAR(pain), 0]; +private _startPain = GET_PAIN_TOTAL(_unit); #endif [QEGVAR(medical_engine,woundReceived), [_unit, _bodyPart, _damageToAdd, _instigator, _typeOfDamage]] call CBA_fnc_localEvent; #ifdef DEBUG_TESTRESULTS private _endDmg = _unit getVariable [QGVAR(bodyPartDamage), [-1]]; -private _endPain = _unit getVariable [QGVAR(pain), 0]; +private _endPain = GET_PAIN_TOTAL(_unit); private _typeOfDamageAdj = _typeOfDamage call EFUNC(medical_damage,getTypeOfDamage); private _config = configFile >> "ACE_Medical_Injuries" >> "damageTypes" >> _typeOfDamageAdj; private _selectionSpecific = true; diff --git a/addons/medical/functions/fnc_adjustPainLevel.sqf b/addons/medical/functions/fnc_adjustPainLevel.sqf index 0656eb6be8..5183bee6f1 100644 --- a/addons/medical/functions/fnc_adjustPainLevel.sqf +++ b/addons/medical/functions/fnc_adjustPainLevel.sqf @@ -24,8 +24,6 @@ TRACE_2("adjustPainLevel",_unit,_desiredPainLevel); _desiredPainLevel = _desiredPainLevel * GVAR(painCoefficient); -private _pain = _unit getVariable [QGVAR(pain), 0]; +private _pain = GET_PAIN_TOTAL(_unit); -_pain = 0 max (_pain max _desiredPainLevel) min 1; - -_unit setVariable [QGVAR(pain), _pain]; +SET_PAIN_TOTAL(_unit,_pain max _desiredPainLevel,false); diff --git a/addons/medical/functions/fnc_dev_watchMedicalStats.sqf b/addons/medical/functions/fnc_dev_watchMedicalStats.sqf index 49e9df62ed..351657d8f5 100644 --- a/addons/medical/functions/fnc_dev_watchMedicalStats.sqf +++ b/addons/medical/functions/fnc_dev_watchMedicalStats.sqf @@ -33,7 +33,7 @@ _return pushBack ""; // State: - private _hasStableVitals = [_unit] call EFUNC(medical,hasStableVitals); + private _hasStableVitals = [_unit] call EFUNC(medical_status,hasStableVitals); private _targetState = [_unit, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState; if (!local _unit) then {_targetState = "NotLocal";}; private _color = switch (_targetState) do {case "Default": {"33FF33"}; case "Injured": {"FF3333"}; case "Unconscious": {"FF8833"}; case "CardiacArrest": {"FF33AA"}; default {"555555"}}; @@ -48,8 +48,8 @@ _return pushBack format [" - [Loss: %1] %2", _bloodLoss toFixed 5, _secondsToHeartstop]; // Heart: - private _cardiacOutput = [_unit] call EFUNC(medical,getCardiacOutput); - private _heartRate = _unit getVariable [QEGVAR(medical,heartRate), DEFAULT_HEART_RATE]; + private _cardiacOutput = [_unit] call EFUNC(medical_status,getCardiacOutput); + private _heartRate = GET_HEART_RATE(_unit); GET_BLOOD_PRESSURE(_unit) params ["_bpLow", "_bpHigh"]; _return pushBack format ["CardiacOutput %1", _cardiacOutput toFixed 5]; _return pushBack format [" - [HR: %1] [BP: %2 / %3]", _heartRate toFixed 1, _bpLow toFixed 1, _bpHigh toFixed 1]; diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index f545259b63..992413ef16 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -62,7 +62,7 @@ if (_show == 1) then { if (((_target getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then { _genericMessages pushback [localize ELSTRING(medical,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; }; - if (EGVAR(medical,showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical,isMedic)}) then { + if (EGVAR(medical,showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical_status,isMedic)}) then { private _painLevel = GET_PAIN_PERCEIVED(_target); if (_painLevel > 0) then { private _painText = localize ELSTRING(medical,Status_Pain); diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index 590cd7d2b3..dad7f8dbeb 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -20,6 +20,6 @@ params ["_unit"]; if (!local _unit) exitWith {}; -_unit setVariable [QGVAR(pain), 0, true]; -_unit setVariable [QGVAR(heartRate), 0, true]; +SET_PAIN_TOTAL(_unit,0); +SET_HEART_RATE(_unit,0); _unit setVariable [QGVAR(bloodPressure), [0, 0], true]; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf index 2f9d1a5522..dd81f2e6ea 100644 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -50,10 +50,10 @@ if (!alive _unit) exitWith { // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation if !(_unit getVariable ["ACE_isUnconscious",false]) exitWith { - TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call FUNC(isBeingCarried), [_unit] call FUNC(isBeingDragged), _idPFH, _unit getVariable QGVAR(unconsciousArguments),animationState _unit); + TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call EFUNC(medical_status,isBeingCarried), [_unit] call EFUNC(medical_status,isBeingDragged), _idPFH, _unit getVariable QGVAR(unconsciousArguments),animationState _unit); // TODO, handle this with carry instead, so we can remove the PFH here. // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations - if !(([_unit] call FUNC(isBeingCarried)) || ([_unit] call FUNC(isBeingDragged))) then { + if !(([_unit] call EFUNC(medical_status,isBeingCarried)) || ([_unit] call EFUNC(medical_status,isBeingDragged))) then { if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { TRACE_1("Removing fake weapon [on wakeup]",_unit); _unit removeWeapon "ACE_FakePrimaryWeapon"; diff --git a/addons/medical/script_macros_medical.hpp b/addons/medical/script_macros_medical.hpp index e8632d2364..e8485cbb3c 100644 --- a/addons/medical/script_macros_medical.hpp +++ b/addons/medical/script_macros_medical.hpp @@ -60,11 +60,16 @@ // - Status macro functions --------------------------------------------------- // These macros provide the same functionality as the functions in the status // component, but are slightly faster (because most are just object variables) -#define GET_PAIN_TOTAL(unit) (unit getVariable [QEGVAR(medical_status,pain), 0]) -#define GET_PAIN_PERCEIVED(unit) ([unit] call EFUNC(medical_status,getPainPerceived)) // Just for consistency -#define GET_HEART_RATE(unit) (unit getVariable [QEGVAR(medical_status,heartRate), DEFAULT_HEART_RATE]) -#define GET_BLOOD_VOLUME(unit) (unit getVariable [QEGVAR(medical_status,bloodVolume), DEFAULT_BLOOD_VOLUME]) #define GET_BLOOD_LOSS(unit) ([unit] call EFUNC(medical_status,getBloodLoss)) // Just for consistency #define GET_BLOOD_PRESSURE(unit) ([unit] call EFUNC(medical_status,getBloodPressure)) // Just for consistency -#define IS_UNCONSCIOUS(unit) (unit getVariable [QEGVAR(medical_status,isUnconscious), false]) +#define GET_BLOOD_VOLUME(unit) (unit getVariable [QEGVAR(medical_status,bloodVolume), DEFAULT_BLOOD_VOLUME]) +#define GET_HEART_RATE(unit) (unit getVariable [QEGVAR(medical_status,heartRate), DEFAULT_HEART_RATE]) +#define GET_PAIN_PERCEIVED(unit) ([unit] call EFUNC(medical_status,getPainPerceived)) // Just for consistency +#define GET_PAIN_TOTAL(unit) (unit getVariable [QEGVAR(medical_status,pain), 0]) #define IS_IN_PAIN(unit) (GET_PAIN_PERCEIVED(unit) > 0) +#define IS_UNCONSCIOUS(unit) (unit getVariable [QEGVAR(medical_status,isUnconscious), false]) +// Setters have overloaded versions for locality handling +#define SET_HEART_RATE(unit,value) unit setVariable [QEGVAR(medical_status,heartRate), value, true] +#define SET_HEART_RATE(unit,value,sync) unit setVariable [QEGVAR(medical_status,heartRate), value, sync] +#define SET_PAIN_TOTAL(unit,value) unit setVariable [QEGVAR(medical_status,pain), 0 max (value) min 1, true] +#define SET_PAIN_TOTAL(unit,value,sync) unit setVariable [QEGVAR(medical_status,pain), 0 max (value) min 1, sync] diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index 101aa6ac5e..a07e35bc77 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -4,7 +4,7 @@ TRACE_1("settingsInitialized", GVAR(enabledFor)); if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients - + // Only run for AI that does not have to deal with advanced medical if (EGVAR(medical,enableFor) == 1 || {hasInterface}) exitWith {}; @@ -19,7 +19,7 @@ private _medic = objNull; { - if ((!isPlayer _x) && {[_x] call EFUNC(medical,isMedic)}) exitWith { + if ((!isPlayer _x) && {[_x] call EFUNC(medical_status,isMedic)}) exitWith { _medic = _x; }; } forEach (units _unit); diff --git a/addons/medical_ai/functions/fnc_canRequestMedic.sqf b/addons/medical_ai/functions/fnc_canRequestMedic.sqf index 39a5063f24..6c8ae97a4c 100644 --- a/addons/medical_ai/functions/fnc_canRequestMedic.sqf +++ b/addons/medical_ai/functions/fnc_canRequestMedic.sqf @@ -19,10 +19,10 @@ // we ignore this here. We need to "notice" the medic that he should // treat other units, or else he won't do anything on his own. -if ([_this] call EFUNC(medical,isMedic) || {vehicle _this != _this}) exitWith {false}; +if ([_this] call EFUNC(medical_status,isMedic) || {vehicle _this != _this}) exitWith {false}; { - if ([_x] call EFUNC(medical,isMedic) && {!([_x] call EFUNC(common,isPlayer))}) exitWith { + if ([_x] call EFUNC(medical_status,isMedic) && {!([_x] call EFUNC(common,isPlayer))}) exitWith { _this setVariable [QGVAR(assignedMedic), _x]; true }; diff --git a/addons/medical_gui/functions/fnc_updateUIInfo.sqf b/addons/medical_gui/functions/fnc_updateUIInfo.sqf index 0b7c46b42f..fc7fd967ca 100644 --- a/addons/medical_gui/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_gui/functions/fnc_updateUIInfo.sqf @@ -39,7 +39,7 @@ if (((_target getVariable [QEGVAR(medical,tourniquets), [0, 0, 0, 0, 0, 0]]) sel _genericMessages pushBack [localize ELSTRING(medical,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; }; -if (EGVAR(medical,showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical,isMedic)}) then { +if (EGVAR(medical,showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical_status,isMedic)}) then { private _painLevel = GET_PAIN_PERCEIVED(_target); if (_painLevel > 0) then { private _painText = localize ELSTRING(medical,Status_Pain); diff --git a/addons/medical_statemachine/Statemachine.hpp b/addons/medical_statemachine/Statemachine.hpp index 3abe7d101e..1d9a08cba9 100644 --- a/addons/medical_statemachine/Statemachine.hpp +++ b/addons/medical_statemachine/Statemachine.hpp @@ -51,7 +51,7 @@ class ACE_Medical_StateMachine { }; class WakeUp { targetState = "Injured"; - condition = QUOTE(_this call FUNC(hasStableVitals)); + condition = QUOTE(_this call EFUNC(medical_status,hasStableVitals)); events[] = {QGVAR(WakeUp)}; onTransition = QUOTE([ARR_2(_this,(false))] call FUNC(setUnconsciousStatemachine)); }; diff --git a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf index b73d341c42..d3a6167976 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf @@ -21,4 +21,4 @@ _time = _time + random [_time*-0.1, 0, _time*0.1]; _unit setVariable [QGVAR(cardiacArrestTime), _time]; _unit setVariable [QGVAR(cardiacArrestStart), CBA_missionTime]; -[_unit] call FUNC(setCardiacArrest); +[_unit] call EFUNC(medical_status,setCardiacArrest); diff --git a/addons/medical_statemachine/functions/fnc_handleStateDefault.sqf b/addons/medical_statemachine/functions/fnc_handleStateDefault.sqf index 098ea971a1..f3027d1ee8 100644 --- a/addons/medical_statemachine/functions/fnc_handleStateDefault.sqf +++ b/addons/medical_statemachine/functions/fnc_handleStateDefault.sqf @@ -8,7 +8,7 @@ if (!alive _unit) exitWith {}; // If locality changed, broadcast the last medical state and finish the local loop if (!local _unit) exitWith { - _unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE], true]; + SET_HEART_RATE(_unit,GET_HEART_RATE(_unit)); _unit setVariable [QGVAR(bloodPressure), _unit getVariable [QGVAR(bloodPressure), [80, 120]], true]; _unit setVariable [QGVAR(bloodVolume), _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME], true]; }; diff --git a/addons/medical_statemachine/functions/fnc_handleStateInjured.sqf b/addons/medical_statemachine/functions/fnc_handleStateInjured.sqf index 098ea971a1..f3027d1ee8 100644 --- a/addons/medical_statemachine/functions/fnc_handleStateInjured.sqf +++ b/addons/medical_statemachine/functions/fnc_handleStateInjured.sqf @@ -8,7 +8,7 @@ if (!alive _unit) exitWith {}; // If locality changed, broadcast the last medical state and finish the local loop if (!local _unit) exitWith { - _unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE], true]; + SET_HEART_RATE(_unit,GET_HEART_RATE(_unit)); _unit setVariable [QGVAR(bloodPressure), _unit getVariable [QGVAR(bloodPressure), [80, 120]], true]; _unit setVariable [QGVAR(bloodVolume), _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME], true]; }; diff --git a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf index 08420c3a8e..b0abdc7289 100644 --- a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf +++ b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf @@ -9,7 +9,7 @@ if (!alive _unit) exitWith {}; // If locality changed, broadcast the last medical state and finish the local loop if (!local _unit) exitWith { - _unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE], true]; + SET_HEART_RATE(_unit,GET_HEART_RATE(_unit)); _unit setVariable [QGVAR(bloodPressure), _unit getVariable [QGVAR(bloodPressure), [80, 120]], true]; _unit setVariable [QGVAR(bloodVolume), _unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME], true]; }; @@ -23,7 +23,7 @@ if (_painLevel > 0) then { // Handle spontaneous wakeup from unconsciousness if (GVAR(spontaneousWakeUpChance) > 0) then { - if (_unit call FUNC(hasStableVitals)) then { + if (_unit call EFUNC(medical_status,hasStableVitals)) then { private _lastWakeUpCheck = _unit getVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then { TRACE_2("Checking for wake up",_unit,GVAR(spontaneousWakeUpChance)); diff --git a/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf b/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf index fa4c41387a..c9182874ca 100644 --- a/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf +++ b/addons/medical_statemachine/functions/fnc_leftStateCardiacArrest.sqf @@ -16,5 +16,5 @@ params ["_unit"]; _unit setVariable [QGVAR(inCardiacArrest), false, true]; _unit setVariable [QGVAR(cardiacArrestStart), nil]; -_unit setVariable [QGVAR(heartRate), 40, true]; +SET_HEART_RATE(_unit,40); _unit setVariable [QGVAR(lastTimeUpdated), CBA_missionTime]; diff --git a/addons/medical_status/XEH_PREP.hpp b/addons/medical_status/XEH_PREP.hpp index dd47959822..a7459567a1 100644 --- a/addons/medical_status/XEH_PREP.hpp +++ b/addons/medical_status/XEH_PREP.hpp @@ -3,9 +3,7 @@ PREP(getBloodLoss); PREP(getBloodPressure); PREP(getBloodVolumeChange); PREP(getCardiacOutput); -PREP(getHeartRate); PREP(getPainPerceived); -PREP(getPainTotal); PREP(hasStableVitals); PREP(hasTourniquetAppliedTo); PREP(initUnit); @@ -16,9 +14,6 @@ PREP(isInMedicalVehicle); PREP(isInStableCondition); PREP(isMedic); PREP(isMedicalVehicle); -PREP(isUnconscious); PREP(setCardiacArrest); PREP(setDead); -PREP(setHeartRate); -PREP(setPainTotal); PREP(setUnconscious); diff --git a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf index c955bb73f5..f4908406fc 100644 --- a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf @@ -11,7 +11,7 @@ * Blood volume change (liters per second) * * Example: - * [player, 1, true] call ACE_medical_fnc_getBloodVolumeChange + * [player, 1, true] call ACE_medical_status_fnc_getBloodVolumeChange * * Public: No */ diff --git a/addons/medical_status/functions/fnc_getCardiacOutput.sqf b/addons/medical_status/functions/fnc_getCardiacOutput.sqf index 8176a1fbe4..e94cd3ac4b 100644 --- a/addons/medical_status/functions/fnc_getCardiacOutput.sqf +++ b/addons/medical_status/functions/fnc_getCardiacOutput.sqf @@ -9,7 +9,7 @@ * Current cardiac output (liter per second) * * Example: - * [player] call ace_medical_fnc_getCardiacOutput + * [player] call ace_medical_status_fnc_getCardiacOutput * * Public: No */ @@ -26,8 +26,8 @@ params ["_unit"]; -private _bloodVolume = ((_unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME]) / DEFAULT_BLOOD_VOLUME) * 100; -private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE]; +private _bloodVolume = (GET_BLOOD_VOLUME(_unit) / DEFAULT_BLOOD_VOLUME) * 100; +private _heartRate = GET_HEART_RATE(_unit); private _cardiacOutput = ((_bloodVolume / MODIFIER_CARDIAC_OUTPUT) + ((_heartRate / DEFAULT_HEART_RATE) - 1)) / 60; (0 max _cardiacOutput) diff --git a/addons/medical_status/functions/fnc_getHeartRate.sqf b/addons/medical_status/functions/fnc_getHeartRate.sqf deleted file mode 100644 index 0514b1acd0..0000000000 --- a/addons/medical_status/functions/fnc_getHeartRate.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Author: BaerMitUmlaut - * Get the heart rate of a unit. - * - * Arguments: - * 0: The Unit - * - * Return Value: - * Heart Rate - */ -#include "script_component.hpp" -params ["_unit"]; - -_unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE] diff --git a/addons/medical_status/functions/fnc_getPainPerceived.sqf b/addons/medical_status/functions/fnc_getPainPerceived.sqf index 1018276aa3..0b6bc129c6 100644 --- a/addons/medical_status/functions/fnc_getPainPerceived.sqf +++ b/addons/medical_status/functions/fnc_getPainPerceived.sqf @@ -14,7 +14,7 @@ params ["_unit"]; -private _pain = _unit getVariable [QGVAR(pain), 0]; +private _pain = GET_PAIN_TOTAL(_unit); private _painSuppress = _unit getVariable [QGVAR(painSuppress), 0]; (0 max (_pain - _painSuppress) min 1) diff --git a/addons/medical_status/functions/fnc_getPainTotal.sqf b/addons/medical_status/functions/fnc_getPainTotal.sqf deleted file mode 100644 index 9375eb2590..0000000000 --- a/addons/medical_status/functions/fnc_getPainTotal.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Author: BaerMitUmlaut - * Get the total pain level of a unit. - * - * Arguments: - * 0: The Unit - * - * Return Value: - * Pain level (0 .. 1) - */ -#include "script_component.hpp" -params ["_unit"]; - -_unit getVariable [QGVAR(pain), 0] diff --git a/addons/medical_status/functions/fnc_hasStableVitals.sqf b/addons/medical_status/functions/fnc_hasStableVitals.sqf index 395c75fb5d..e360af8a90 100644 --- a/addons/medical_status/functions/fnc_hasStableVitals.sqf +++ b/addons/medical_status/functions/fnc_hasStableVitals.sqf @@ -9,7 +9,7 @@ * Has stable vitals * * Example: - * [player] call ace_medical_fnc_hasStableVitals + * [player] call ace_medical_status_fnc_hasStableVitals * * Public: No */ @@ -28,7 +28,7 @@ private _bloodPressure = GET_BLOOD_PRESSURE(_unit); _bloodPressure params ["_bloodPressureL", "_bloodPressureH"]; if (_bloodPressureL < 50 || {_bloodPressureH < 60}) exitWith { false }; -private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE]; +private _heartRate = GET_HEART_RATE(_unit); if (_heartRate < 40) exitWith { false }; true diff --git a/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf index fcceeec601..6d7b65caa4 100644 --- a/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf +++ b/addons/medical_status/functions/fnc_hasTourniquetAppliedTo.sqf @@ -10,7 +10,7 @@ * Has tourniquet applied * * Example: - * [player, "leftleg"] call ace_medical_fnc_hasTourniquetAppliedTo + * [player, "leftleg"] call ace_medical_status_fnc_hasTourniquetAppliedTo * * Public: Yes */ diff --git a/addons/medical_status/functions/fnc_initUnit.sqf b/addons/medical_status/functions/fnc_initUnit.sqf index e18bb5bc17..77f39ac234 100644 --- a/addons/medical_status/functions/fnc_initUnit.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -23,7 +23,7 @@ if (damage _unit > 0) then { // - Blood and heart ---------------------------------------------------------- _unit setVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME, true]; -_unit setVariable [QGVAR(heartRate), DEFAULT_HEART_RATE, true]; +SET_HEART_RATE(_unit,DEFAULT_HEART_RATE); _unit setVariable [QGVAR(heartRateAdjustments), [], true]; _unit setVariable [QGVAR(bloodPressure), [80, 120], true]; _unit setVariable [QGVAR(peripheralResistance), 100, true]; @@ -33,7 +33,7 @@ _unit setVariable [QGVAR(hasLostBlood), 0, true]; _unit setVariable [QGVAR(isBleeding), false, true]; // - Pain --------------------------------------------------------------------- -_unit setVariable [QGVAR(pain), 0, true]; +SET_PAIN_TOTAL(_unit,0); _unit setVariable [QGVAR(hasPain), false, true]; _unit setVariable [QGVAR(painSuppress), 0, true]; _unit setVariable [QGVAR(painSuppressAdjustments), [], true]; diff --git a/addons/medical_status/functions/fnc_isBeingCarried.sqf b/addons/medical_status/functions/fnc_isBeingCarried.sqf index 26ce932901..3fedfa677d 100644 --- a/addons/medical_status/functions/fnc_isBeingCarried.sqf +++ b/addons/medical_status/functions/fnc_isBeingCarried.sqf @@ -9,7 +9,7 @@ * Is being carried * * Example: - * [bob] call ace_medical_fnc_isBeingCarried + * [bob] call ace_medical_status_fnc_isBeingCarried * * Public: No */ diff --git a/addons/medical_status/functions/fnc_isBeingDragged.sqf b/addons/medical_status/functions/fnc_isBeingDragged.sqf index b0297c0049..f71b055e33 100644 --- a/addons/medical_status/functions/fnc_isBeingDragged.sqf +++ b/addons/medical_status/functions/fnc_isBeingDragged.sqf @@ -9,7 +9,7 @@ * Is being dragged * * Example: - * [bob] call ace_medical_fnc_isBeingDragged + * [bob] call ace_medical_status_fnc_isBeingDragged * * Public: No */ diff --git a/addons/medical_status/functions/fnc_isInMedicalFacility.sqf b/addons/medical_status/functions/fnc_isInMedicalFacility.sqf index 12e52ada19..52b5ec01c8 100644 --- a/addons/medical_status/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical_status/functions/fnc_isInMedicalFacility.sqf @@ -9,7 +9,7 @@ * Is in medical facility * * Example: - * [player] call ace_medical_fnc_isInMedicalFacility + * [player] call ace_medical_status_fnc_isInMedicalFacility * * Public: Yes */ diff --git a/addons/medical_status/functions/fnc_isInMedicalVehicle.sqf b/addons/medical_status/functions/fnc_isInMedicalVehicle.sqf index 53b82284dd..090cff73ec 100644 --- a/addons/medical_status/functions/fnc_isInMedicalVehicle.sqf +++ b/addons/medical_status/functions/fnc_isInMedicalVehicle.sqf @@ -9,7 +9,7 @@ * Is unit in medical vehicle? * * Example: - * [player] call ace_medical_fnc_isInMedicalVehicle + * [player] call ace_medical_status_fnc_isInMedicalVehicle * * Public: Yes */ diff --git a/addons/medical_status/functions/fnc_isMedic.sqf b/addons/medical_status/functions/fnc_isMedic.sqf index f09fe88dbb..de00803804 100644 --- a/addons/medical_status/functions/fnc_isMedic.sqf +++ b/addons/medical_status/functions/fnc_isMedic.sqf @@ -10,7 +10,7 @@ * Is in of medic class * * Example: - * [player] call ace_medical_fnc_isMedic + * [player] call ace_medical_status_fnc_isMedic * * Public: Yes */ diff --git a/addons/medical_status/functions/fnc_isMedicalVehicle.sqf b/addons/medical_status/functions/fnc_isMedicalVehicle.sqf index 3d21293248..92539feaa2 100644 --- a/addons/medical_status/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical_status/functions/fnc_isMedicalVehicle.sqf @@ -9,7 +9,7 @@ * Is in of medic class * * Example: - * [cursorObject] call ace_medical_fnc_isMedicalVehicle + * [cursorObject] call ace_medical_status_fnc_isMedicalVehicle * * Public: Yes */ diff --git a/addons/medical_status/functions/fnc_isUnconscious.sqf b/addons/medical_status/functions/fnc_isUnconscious.sqf deleted file mode 100644 index 3e78f025d5..0000000000 --- a/addons/medical_status/functions/fnc_isUnconscious.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Author: BaerMitUmlaut - * Check if the unit is unconscious. - * - * Arguments: - * 0: The Unit - * - * Return Value: - * Is unconscious - */ -#include "script_component.hpp" -params ["_unit"]; - -_unit getVariable [QGVAR(isUnconscious), false] diff --git a/addons/medical_status/functions/fnc_setCardiacArrest.sqf b/addons/medical_status/functions/fnc_setCardiacArrest.sqf index 2baba726d7..120cf79cf7 100644 --- a/addons/medical_status/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical_status/functions/fnc_setCardiacArrest.sqf @@ -22,7 +22,7 @@ params ["_unit"]; if (_unit getVariable [QGVAR(inCardiacArrest), false]) exitWith {}; _unit setVariable [QGVAR(inCardiacArrest), true, true]; -_unit setVariable [QGVAR(heartRate), 0, true]; +SET_HEART_RATE(_unit,0); ["ace_cardiacArrestEntered", [_unit]] call CBA_fnc_localEvent; diff --git a/addons/medical_status/functions/fnc_setDead.sqf b/addons/medical_status/functions/fnc_setDead.sqf index c76fd9265d..fd8a5856ca 100644 --- a/addons/medical_status/functions/fnc_setDead.sqf +++ b/addons/medical_status/functions/fnc_setDead.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [bob, "bloodloss"] call ace_medical_fnc_setDead; + * [bob, "bloodloss"] call ace_medical_status_fnc_setDead; * * Public: No */ diff --git a/addons/medical_status/functions/fnc_setHeartRate.sqf b/addons/medical_status/functions/fnc_setHeartRate.sqf deleted file mode 100644 index 644592cee4..0000000000 --- a/addons/medical_status/functions/fnc_setHeartRate.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Author: BaerMitUmlaut - * Sets the heart rate of a unit. - * - * Arguments: - * 0: The Unit - * 1: Heart rate - * - * Return Value: - * None - */ -#include "script_component.hpp" -params ["_unit", "_heartRate"]; - -_unit setVariable [QGVAR(heartRate), _heartRate]; diff --git a/addons/medical_status/functions/fnc_setPainTotal.sqf b/addons/medical_status/functions/fnc_setPainTotal.sqf deleted file mode 100644 index aca8fe4d79..0000000000 --- a/addons/medical_status/functions/fnc_setPainTotal.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Author: BaerMitUmlaut - * Sets the total pain level of a unit. - * - * Arguments: - * 0: The Unit - * 1: Pain level (0..1) - * - * Return Value: - * None - */ -#include "script_component.hpp" -params ["_unit", "_pain"]; - -_unit setVariable [QGVAR(pain), 0 max _pain min 1]; diff --git a/addons/medical_status/functions/fnc_setUnconscious.sqf b/addons/medical_status/functions/fnc_setUnconscious.sqf index 8f42bd40a2..381f01dd2d 100644 --- a/addons/medical_status/functions/fnc_setUnconscious.sqf +++ b/addons/medical_status/functions/fnc_setUnconscious.sqf @@ -13,8 +13,8 @@ * Success? * * Example: - * [bob, true] call ace_medical_fnc_setUnconscious; - * [player, true, 5, true] call ace_medical_fnc_setUnconscious; + * [bob, true] call ace_medical_status__fnc_setUnconscious; + * [player, true, 5, true] call ace_medical_status_fnc_setUnconscious; * * Public: yes */ @@ -63,7 +63,7 @@ if (_knockOut) then { _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime + _minWaitingTime - SPONTANEOUS_WAKE_UP_INTERVAL]; }; }; - + [QGVAR(knockOut), _unit] call CBA_fnc_localEvent; } else { [QGVAR(WakeUp), _unit] call CBA_fnc_localEvent; diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index 6d1335701b..bc2210e6b6 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -77,7 +77,7 @@ class GVAR(Actions) { items[] = {"ACE_tourniquet"}; treatmentTime = 7; callbackSuccess = QFUNC(treatmentTourniquet); - condition = QUOTE(!([ARR_2(_target,_bodyPart)] call EFUNC(medical,hasTourniquetAppliedTo))); + condition = QUOTE(!([ARR_2(_target,_bodyPart)] call EFUNC(medical_status,hasTourniquetAppliedTo))); litter[] = {}; }; class RemoveTourniquet: Tourniquet { @@ -85,7 +85,7 @@ class GVAR(Actions) { displayNameProgress = ECSTRING(medical,RemovingTourniquet); items[] = {}; callbackSuccess = QFUNC(treatmentTourniquetRemove); - condition = QUOTE([ARR_2(_target,_bodyPart)] call EFUNC(medical,hasTourniquetAppliedTo)); + condition = QUOTE([ARR_2(_target,_bodyPart)] call EFUNC(medical_status,hasTourniquetAppliedTo)); }; // --- syringes @@ -282,7 +282,7 @@ class GVAR(Actions) { displayName = ECSTRING(medical,Use_Aid_Kit); displayNameProgress = ECSTRING(medical,TreatmentAction); category = "advanced"; - condition = QUOTE(_target call EFUNC(medical,isInStableCondition)); + condition = QUOTE(_target call EFUNC(medical_status,isInStableCondition)); items[] = {"ACE_personalAidKit"}; treatmentLocations[] = {QEGVAR(medical,useLocation_PAK)}; requiredMedic = QEGVAR(medical,medicSetting_PAK); diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index 350e6d1f59..8be374de4d 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -48,8 +48,6 @@ PREP(getTriageStatus); PREP(handleBandageOpening); PREP(healTime); PREP(HealTimeMedkit); -PREP(isBeingCarried); -PREP(isBeingDragged); PREP(onMedicationUsage); // items diff --git a/addons/medical_treatment/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical_treatment/functions/fnc_actionCheckBloodPressureLocal.sqf index 1999218f82..e6c8647625 100644 --- a/addons/medical_treatment/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical_treatment/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -18,7 +18,7 @@ params ["_caller", "_target", "_bodyPart"]; private _bloodPressure = [0, 0]; -if (alive _target && !([_target, _bodyPart] call EFUNC(medical,hasTourniquetAppliedTo))) then { +if (alive _target && !([_target, _bodyPart] call EFUNC(medical_status,hasTourniquetAppliedTo))) then { _bloodPressure = GET_BLOOD_PRESSURE(_target); }; @@ -28,7 +28,7 @@ private _logOutPut = ELSTRING(medical,Check_Bloodpressure_NoBloodpressure); _bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"]; if (_bloodPressureHigh > 20) then { - if (_caller call EFUNC(medical,isMedic)) then { + if (_caller call EFUNC(medical_status,isMedic)) then { _bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_1); _logOutPut = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow]; } else { diff --git a/addons/medical_treatment/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical_treatment/functions/fnc_actionCheckPulseLocal.sqf index 39f362c1f8..7e85f55cba 100644 --- a/addons/medical_treatment/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical_treatment/functions/fnc_actionCheckPulseLocal.sqf @@ -18,7 +18,7 @@ params ["_caller", "_target", "_bodyPart"]; private _heartRate = 0; -if (alive _target && !([_target, _bodyPart] call EFUNC(medical,hasTourniquetAppliedTo))) then { +if (alive _target && !([_target, _bodyPart] call EFUNC(medical_status,hasTourniquetAppliedTo))) then { _heartRate = _target getVariable [QEGVAR(medical,heartRate), 80]; }; @@ -26,7 +26,7 @@ private _heartRateOutput = ELSTRING(medical,Check_Pulse_Output_5); private _logOutPut = ELSTRING(medical,Check_Pulse_None); if (_heartRate > 1.0) then { - if (_caller call EFUNC(medical,isMedic)) then { + if (_caller call EFUNC(medical_status,isMedic)) then { _heartRateOutput = ELSTRING(medical,Check_Pulse_Output_1); _logOutPut = format ["%1", round(_heartRate)]; } else { diff --git a/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf b/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf index ec9f6cfb85..69d00aa3cd 100644 --- a/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf @@ -23,11 +23,11 @@ if ([_target] call EFUNC(common,isAwake)) exitWith { [QEGVAR(common,displayTextStructured), [[ELSTRING(medical,CanNotLoaded), _target call EFUNC(common,getName)], 1.5, _caller], _caller] call CBA_fnc_targetEvent; }; -if ([_target] call FUNC(isBeingCarried)) then { +if ([_target] call EFUNC(medical_status,isBeingCarried)) then { [_caller, _target] call EFUNC(dragging,dropObject_carry); }; -if ([_target] call FUNC(isBeingDragged)) then { +if ([_target] call EFUNC(medical_status,isBeingDragged)) then { [_caller, _target] call EFUNC(dragging,dropObject); }; diff --git a/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf index e2329bd5fc..c0e574beea 100644 --- a/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf +++ b/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf @@ -27,7 +27,7 @@ if (!local _target) exitWith { if (alive _target) then { TRACE_1("manually killing with setDead",_target); - [_target, true, "buried_alive"] call EFUNC(medical,setDead); + [_target, true, "buried_alive"] call EFUNC(medical_status,setDead); }; private _position = (getPosASL _target) vectorAdd [0, 0, 0.2]; diff --git a/addons/medical_treatment/functions/fnc_calculateBlood.sqf b/addons/medical_treatment/functions/fnc_calculateBlood.sqf index d805ee1ffa..2721afd8c9 100644 --- a/addons/medical_treatment/functions/fnc_calculateBlood.sqf +++ b/addons/medical_treatment/functions/fnc_calculateBlood.sqf @@ -23,7 +23,7 @@ private _syncValues = (CBA_missionTime - _lastTimeValuesSynced) >= (10 + floor(r _unit setVariable [QEGVAR(medical,lastTimeUpdated), CBA_missionTime]; if (_deltaT != 0) then { - private _change = ([_unit, _deltaT, _syncValues] call EFUNC(medical,getBloodVolumeChange)); + private _change = ([_unit, _deltaT, _syncValues] call EFUNC(medical_status,getBloodVolumeChange)); private _bloodVolume = (_unit getVariable [QEGVAR(medical,bloodVolume), DEFAULT_BLOOD_VOLUME]) + _change; _bloodVolume = 0 max _bloodVolume min DEFAULT_BLOOD_VOLUME; _unit setVariable [QEGVAR(medical,bloodVolume), _bloodVolume, _syncValues]; diff --git a/addons/medical_treatment/functions/fnc_canTreat.sqf b/addons/medical_treatment/functions/fnc_canTreat.sqf index d4d08af278..00b30ec7b0 100644 --- a/addons/medical_treatment/functions/fnc_canTreat.sqf +++ b/addons/medical_treatment/functions/fnc_canTreat.sqf @@ -52,7 +52,7 @@ if (isNumber (_config >> "requiredMedic")) then { }; }; -if !([_caller, _medicRequired] call EFUNC(medical,isMedic)) exitWith {false}; +if !([_caller, _medicRequired] call EFUNC(medical_status,isMedic)) exitWith {false}; // check selection private _allowedSelections = getArray (_config >> "allowedSelections") apply {toLower _x}; @@ -92,8 +92,8 @@ private _locations = getArray (_config >> "treatmentLocations") apply {toLower _ if ("all" in _locations) then { _locations = true; } else { - private _medFacility = {([_caller] call EFUNC(medical,isInMedicalFacility)) || ([_target] call EFUNC(medical,isInMedicalFacility))}; - private _medVeh = {([_caller] call EFUNC(medical,isInMedicalVehicle)) || ([_target] call EFUNC(medical,isInMedicalVehicle))}; + private _medFacility = {([_caller] call EFUNC(medical_status,isInMedicalFacility)) || ([_target] call EFUNC(medical_status,isInMedicalFacility))}; + private _medVeh = {([_caller] call EFUNC(medical_status,isInMedicalVehicle)) || ([_target] call EFUNC(medical_status,isInMedicalVehicle))}; { if (_x == "field") exitWith { _locations = true; }; diff --git a/addons/medical_treatment/functions/fnc_hasItem.sqf b/addons/medical_treatment/functions/fnc_hasItem.sqf index 6ed8f080f0..eb975f27f1 100644 --- a/addons/medical_treatment/functions/fnc_hasItem.sqf +++ b/addons/medical_treatment/functions/fnc_hasItem.sqf @@ -33,7 +33,7 @@ if ([_medic, _item] call EFUNC(common,hasItem)) exitWith { private _return = false; -if (vehicle _medic != _medic && {vehicle _medic call EFUNC(medical,isMedicalVehicle)}) then { +if (vehicle _medic != _medic && {vehicle _medic call EFUNC(medical_status,isMedicalVehicle)}) then { { if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {[_x, _item] call EFUNC(common,hasItem)}) exitWith { _return = true; diff --git a/addons/medical_treatment/functions/fnc_isBeingCarried.sqf b/addons/medical_treatment/functions/fnc_isBeingCarried.sqf deleted file mode 100644 index ee61637676..0000000000 --- a/addons/medical_treatment/functions/fnc_isBeingCarried.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Author: PabstMirror - * Returns if a target is being carried. (from ace_dragging) - * - * Arguments: - * 0: Target Unit - * - * Return Value: - * Is being carried - * - * Example: - * [bob] call ACE_medical_treatment_fnc_isBeingCarried - * - * Public: No - */ -#include "script_component.hpp" - -params ["_target"]; - -private "_owner"; - -_owner = _target getVariable [QEGVAR(common,owner), objNull]; - -if (isNull _owner) exitWith {false}; - -(_owner getVariable [QEGVAR(dragging,carriedObject), objNull]) == _target diff --git a/addons/medical_treatment/functions/fnc_isBeingDragged.sqf b/addons/medical_treatment/functions/fnc_isBeingDragged.sqf deleted file mode 100644 index e0d320b495..0000000000 --- a/addons/medical_treatment/functions/fnc_isBeingDragged.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Author: PabstMirror - * Returns if a target is being dragged. (from ace_dragging) - * - * Arguments: - * 0: Target Unit - * - * Return Value: - * Is being dragged - * - * Example: - * [bob] call ACE_medical_treatment_fnc_isBeingDragged - * - * Public: No - */ -#include "script_component.hpp" - -params ["_target"]; - -private "_owner"; - -_owner = _target getVariable [QEGVAR(common,owner), objNull]; - -if (isNull _owner) exitWith {false}; - -(_owner getVariable [QEGVAR(dragging,draggedObject), objNull]) == _target diff --git a/addons/medical_treatment/functions/fnc_useItem.sqf b/addons/medical_treatment/functions/fnc_useItem.sqf index 39f16621d2..c773e78090 100644 --- a/addons/medical_treatment/functions/fnc_useItem.sqf +++ b/addons/medical_treatment/functions/fnc_useItem.sqf @@ -33,7 +33,7 @@ if ([_medic, _item] call EFUNC(common,hasItem)) exitWith { private _return = [false, objNull]; -if (vehicle _medic != _medic && {vehicle _medic call EFUNC(medical,isMedicalVehicle)}) then { +if (vehicle _medic != _medic && {vehicle _medic call EFUNC(medical_status,isMedicalVehicle)}) then { { if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {[_x, _item] call EFUNC(common,hasItem)}) exitWith { ["ace_useItem", [_x, _item], _x] call CBA_fnc_targetEvent; diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index e54ec00d0a..d02a2dc0c7 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -32,7 +32,7 @@ if (_syncValues) then { _unit setVariable [QGVAR(lastMomentValuesSynced), CBA_missionTime]; }; -private _bloodVolume = (_unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME]) + ([_unit, _deltaT, _syncValues] call FUNC(getBloodVolumeChange)); +private _bloodVolume = (_unit getVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME]) + ([_unit, _deltaT, _syncValues] call EFUNC(medical_status,getBloodVolumeChange)); _bloodVolume = 0 max _bloodVolume min DEFAULT_BLOOD_VOLUME; // @todo: replace this and the rest of the setVariable with EFUNC(common,setApproximateVariablePublic) @@ -98,7 +98,7 @@ private _heartRate = [_unit, _deltaT, _syncValues] call FUNC(updateHeartRate); private _bloodPressure = GET_BLOOD_PRESSURE(_unit); _unit setVariable [QGVAR(bloodPressure), _bloodPressure, _syncValues]; -private _cardiacOutput = [_unit] call FUNC(getCardiacOutput); +private _cardiacOutput = [_unit] call EFUNC(medical_status,getCardiacOutput); if (_bloodLoss > BLOOD_LOSS_KNOCK_OUT_THRESHOLD * _cardiacOutput) then { [QGVAR(CriticalVitals), _unit] call CBA_fnc_localEvent; }; diff --git a/addons/medical_vitals/functions/fnc_updateHeartRate.sqf b/addons/medical_vitals/functions/fnc_updateHeartRate.sqf index 573dacd433..6e38b2821b 100644 --- a/addons/medical_vitals/functions/fnc_updateHeartRate.sqf +++ b/addons/medical_vitals/functions/fnc_updateHeartRate.sqf @@ -44,7 +44,7 @@ if (!(_adjustment isEqualTo [])) then { _unit setVariable [QGVAR(heartRateAdjustments), _adjustment, _syncValue]; }; -private _heartRate = _unit getVariable [QGVAR(heartRate), DEFAULT_HEART_RATE]; +private _heartRate = GET_HEART_RATE(_unit); if (!(_unit getVariable [QGVAR(inCardiacArrest), false])) then { private _hrChange = 0; @@ -75,7 +75,7 @@ if (!(_unit getVariable [QGVAR(inCardiacArrest), false])) then { _heartRate = (_heartRate + _deltaT * _hrChange) max 0; }; -_unit setVariable [QGVAR(heartRate), _heartRate, _syncValue]; +SET_HEART_RATE(_unit,_heartRate,_syncValue); _heartRate diff --git a/addons/medical_vitals/functions/fnc_updatePainSuppress.sqf b/addons/medical_vitals/functions/fnc_updatePainSuppress.sqf index 3d9183647e..aeae8e99db 100644 --- a/addons/medical_vitals/functions/fnc_updatePainSuppress.sqf +++ b/addons/medical_vitals/functions/fnc_updatePainSuppress.sqf @@ -44,8 +44,8 @@ if (!(_adjustment isEqualTo [])) then { }; // Handle continuous pain reduction -private _pain = _unit getVariable [QGVAR(pain), 0]; -_unit setVariable [QGVAR(pain), 0 max (_pain - _deltaT / PAIN_FADE_TIME), _syncValue]; +private _pain = GET_PAIN_TOTAL(_unit); +_unit setVariable [QEGVAR(medical_status,pain), 0 max (_pain - _deltaT / PAIN_FADE_TIME), _syncValue]; // Handles simple medication if (!GVAR(advancedMedication)) then {