diff --git a/addons/medical/script_macros_medical.hpp b/addons/medical/script_macros_medical.hpp index a6d787502a..fe90f85327 100644 --- a/addons/medical/script_macros_medical.hpp +++ b/addons/medical/script_macros_medical.hpp @@ -72,9 +72,10 @@ // These variables track gradual adjustments (from medication, etc.) #define VAR_HEART_RATE_ADJ QEGVAR(medical,heartRateAdjustments) #define VAR_PAIN_SUPP_ADJ QEGVAR(medical,painSuppressAdjustments) -// These variables track the current state of status values -#define VAR_IN_PAIN QEGVAR(medical,inPain) -#define VAR_IS_BLEEDING QEGVAR(medical,isBleeding) +// These variables track the current state of status values above +#define VAR_HEMORRHAGE QEGVAR(medical,hemorrhage) +#define VAR_IN_PAIN QEGVAR(medical,inPain) +#define VAR_IS_BLEEDING QEGVAR(medical,isBleeding) // - Unit Functions --------------------------------------------------- @@ -82,6 +83,7 @@ // Defined for easy consistency and speed #define GET_BLOOD_VOLUME(unit) (GETVAR(unit,VAR_BLOOD_VOL,DEFAULT_BLOOD_VOLUME)) #define GET_HEART_RATE(unit) (GETVAR(unit,VAR_HEART_RATE,DEFAULT_HEART_RATE)) +#define GET_HEMORRHAGE(unit) (GETVAR(unit,VAR_HEMORRHAGE,0)) #define GET_PAIN(unit) (GETVAR(unit,VAR_PAIN,0)) #define GET_PAIN_SUPPRESS(unit) (GETVAR(unit,VAR_PAIN_SUPP,0)) #define IN_CRDC_ARRST(unit) (GETVAR(unit,VAR_CRDC_ARRST,false)) diff --git a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf index 75979ec8d1..542d6e6df5 100644 --- a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf @@ -55,7 +55,7 @@ if (_show == 1) then { if IS_BLEEDING(_target) then { _genericMessages pushback [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]]; }; - if (_target getVariable[QEGVAR(medical,hasLostBlood), 0] > 1) then { + if (GET_HEMORRHAGE(_target) > 1) then { _genericMessages pushback [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]]; }; diff --git a/addons/medical_gui/functions/fnc_updateUIInfo.sqf b/addons/medical_gui/functions/fnc_updateUIInfo.sqf index 93750a4e68..9e3ef543e9 100644 --- a/addons/medical_gui/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_gui/functions/fnc_updateUIInfo.sqf @@ -31,7 +31,7 @@ if IS_BLEEDING(_target) then { _genericMessages pushBack [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]]; }; -if (_target getVariable [QEGVAR(medical,hasLostBlood), 0] > 1) then { +if (GET_HEMORRHAGE(_target) > 1) then { _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]]; }; diff --git a/addons/medical_status/functions/fnc_initUnit.sqf b/addons/medical_status/functions/fnc_initUnit.sqf index 81f41fbf00..3a9471bde3 100644 --- a/addons/medical_status/functions/fnc_initUnit.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -29,7 +29,7 @@ _unit setVariable [VAR_BLOOD_PRESS, [80, 120], true]; _unit setVariable [QGVAR(peripheralResistance), 100, true]; _unit setVariable [QGVAR(peripheralResistanceAdjustments), [], true]; _unit setVariable [VAR_CRDC_ARRST, false, true]; -_unit setVariable [QGVAR(hasLostBlood), 0, true]; +_unit setVariable [VAR_HEMORRHAGE, 0, true]; _unit setVariable [VAR_IS_BLEEDING, false, true]; // - Pain --------------------------------------------------------------------- diff --git a/addons/medical_treatment/functions/fnc_actionDiagnose.sqf b/addons/medical_treatment/functions/fnc_actionDiagnose.sqf index de86bb9a0d..046945c803 100644 --- a/addons/medical_treatment/functions/fnc_actionDiagnose.sqf +++ b/addons/medical_treatment/functions/fnc_actionDiagnose.sqf @@ -23,8 +23,9 @@ if (alive _target) then { _genericMessages pushBack ELSTRING(medical,diagnoseDead); }; -if (_target getVariable [QEGVAR(medical,hasLostBlood), 0] > 0) then { - if (_target getVariable [QEGVAR(medical,hasLostBlood), 0] > 1) then { +private _hemorrhage = GET_HEMORRHAGE(_target); +if (_hemorrhage > 0) then { + if (_hemorrhage > 1) then { _genericMessages pushBack ELSTRING(medical,lostBloodALot); } else { _genericMessages pushBack ELSTRING(medical,lostBlood); diff --git a/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf index 9ab9fb27ff..86818102a7 100644 --- a/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf @@ -49,7 +49,7 @@ _target setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true]; // generic medical admin _target setVariable [VAR_CRDC_ARRST, false, true]; _target setVariable [VAR_UNCON, false, true]; -_target setVariable [QEGVAR(medical,hasLostBlood), 0, true]; +_target setVariable [VAR_HEMORRHAGE, 0, true]; _target setVariable [VAR_IS_BLEEDING, false, true]; _target setVariable [VAR_IN_PAIN, false, true]; _target setVariable [VAR_PAIN_SUPP, 0, true]; diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index 10d70f1123..1748e75746 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -39,20 +39,13 @@ _bloodVolume = 0 max _bloodVolume min DEFAULT_BLOOD_VOLUME; _unit setVariable [VAR_BLOOD_VOL, _bloodVolume, _syncValues]; // Set variables for synchronizing information across the net -if (_bloodVolume < BLOOD_VOLUME_CLASS_1_HEMORRHAGE) then { - if (_bloodVolume < BLOOD_VOLUME_CLASS_3_HEMORRHAGE) then { - if (_unit getVariable [QGVAR(hasLostBlood), 0] != 2) then { - _unit setVariable [QGVAR(hasLostBlood), 2, true]; - }; - } else { - if (_unit getVariable [QGVAR(hasLostBlood), 0] != 1) then { - _unit setVariable [QGVAR(hasLostBlood), 1, true]; - }; - }; -} else { - if (_unit getVariable [QGVAR(hasLostBlood), 0] != 0) then { - _unit setVariable [QGVAR(hasLostBlood), 0, true]; - }; +private _hemorrhage = [ + 0, + [1, 3] select (_bloodVolume < BLOOD_VOLUME_CLASS_3_HEMORRHAGE) +] select (_bloodVolume < BLOOD_VOLUME_CLASS_1_HEMORRHAGE); + +if (_hemorrhage != GET_HEMORRHAGE(_unit)) then { + _unit setVariable [VAR_HEMORRHAGE, _hemorrhageClass, true]; }; private _bloodLoss = GET_BLOOD_LOSS(_unit);