From 30a155b750342a59908795587edd72186b7bca5c Mon Sep 17 00:00:00 2001 From: Blue Date: Fri, 20 Jan 2023 13:21:10 +0100 Subject: [PATCH 1/4] Fix internal bleeding not being cleared when HPTX is treated Specifically when the T/HPTX hardcore option is disabled --- .../functions/fnc_treatmentAdvanced_hemopneumothoraxLocal.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/breathing/functions/fnc_treatmentAdvanced_hemopneumothoraxLocal.sqf b/addons/breathing/functions/fnc_treatmentAdvanced_hemopneumothoraxLocal.sqf index 6bce2d9b1..a6aba8400 100644 --- a/addons/breathing/functions/fnc_treatmentAdvanced_hemopneumothoraxLocal.sqf +++ b/addons/breathing/functions/fnc_treatmentAdvanced_hemopneumothoraxLocal.sqf @@ -22,6 +22,7 @@ params ["_medic", "_patient"]; if !(GVAR(tensionhemothorax_hardcore)) exitWith { if ((_patient getVariable [QGVAR(hemopneumothorax), false]) && {_patient getVariable [QGVAR(activeChestSeal), false]}) then { _patient setVariable [QGVAR(hemopneumothorax), false, true]; + [_patient] call EFUNC(circulation,updateInternalBleeding); if (!(_patient getVariable [QGVAR(pneumothorax), false]) && {!(_patient getVariable [QGVAR(hemopneumothorax), false]) && {!(_patient getVariable [QGVAR(tensionpneumothorax), false])}}) then { _patient setVariable [QGVAR(activeChestSeal), false, true]; }; From 6a42604db2d8b81e09a1ec5b999a0f6e72e75899 Mon Sep 17 00:00:00 2001 From: Blue Date: Sat, 21 Jan 2023 13:47:44 +0100 Subject: [PATCH 2/4] Fix no sound playing when doing treatment --- addons/circulation/functions/fnc_treatment.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/circulation/functions/fnc_treatment.sqf b/addons/circulation/functions/fnc_treatment.sqf index 4d14236f1..e55e0008c 100644 --- a/addons/circulation/functions/fnc_treatment.sqf +++ b/addons/circulation/functions/fnc_treatment.sqf @@ -153,7 +153,7 @@ if (vehicle _medic == _medic && {_medicAnim != ""}) then { // Play a random treatment sound globally if defined // Don't attempt to play if sounds array is empty -if (isArray (_config >> "sounds") && count (_config >> "sounds") != 0) then { +if (isArray (_config >> "sounds") && count getArray (_config >> "sounds") != 0) then { selectRandom getArray (_config >> "sounds") params ["_file", ["_volume", 1], ["_pitch", 1], ["_distance", 10]]; playSound3D [_file, objNull, false, getPosASL _medic, _volume, _pitch, _distance]; }; From 347e40b67be8db7e165163969ff04b97ba86e845 Mon Sep 17 00:00:00 2001 From: Blue Date: Tue, 24 Jan 2023 00:47:34 +0100 Subject: [PATCH 3/4] Remove bleeding effect while suffering from HPTX --- addons/circulation/functions/fnc_updateInternalBleeding.sqf | 4 +++- addons/pharma/functions/fnc_getBloodLoss.sqf | 5 ++--- addons/pharma/functions/fnc_getBloodVolumeChange.sqf | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/circulation/functions/fnc_updateInternalBleeding.sqf b/addons/circulation/functions/fnc_updateInternalBleeding.sqf index b7a481f2b..ffa32fcb2 100644 --- a/addons/circulation/functions/fnc_updateInternalBleeding.sqf +++ b/addons/circulation/functions/fnc_updateInternalBleeding.sqf @@ -17,10 +17,12 @@ params ["_unit"]; +private _cardiacOutput = [_unit] call ACEFUNC(medical_status,getCardiacOutput); +private _alphaAction = _unit getVariable [QGVAR(alphaAction), 1]; private _internalBleeding = 0; if (_unit getVariable [QEGVAR(breathing,hemopneumothorax), false]) then { _internalBleeding = _internalBleeding + EGVAR(breathing,HPTXBleedAmount); }; -_unit setVariable [VAR_INTERNAL_BLEEDING, _internalBleeding, true]; \ No newline at end of file +_unit setVariable [VAR_INTERNAL_BLEEDING, _internalBleeding * (_cardiacOutput max 0.05) * ACEGVAR(medical,bleedingCoefficient) * _alphaAction, true]; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_getBloodLoss.sqf b/addons/pharma/functions/fnc_getBloodLoss.sqf index 03c788925..5808fdb2b 100644 --- a/addons/pharma/functions/fnc_getBloodLoss.sqf +++ b/addons/pharma/functions/fnc_getBloodLoss.sqf @@ -18,11 +18,10 @@ params ["_unit"]; private _woundBleeding = GET_WOUND_BLEEDING(_unit); -private _internalBleeding = GET_INTERNAL_BLEEDING(_unit); -if (_woundBleeding + _internalBleeding == 0) exitWith {0}; +if (_woundBleeding == 0) exitWith {0}; private _cardiacOutput = [_unit] call ACEFUNC(medical_status,getCardiacOutput); private _alphaAction = _unit getVariable [QGVAR(alphaAction), 1]; // even if heart stops blood will still flow slowly (gravity) -((_woundBleeding + _internalBleeding) * (_cardiacOutput max 0.05) * ACEGVAR(medical,bleedingCoefficient) * _alphaAction) \ No newline at end of file +(_woundBleeding * (_cardiacOutput max 0.05) * ACEGVAR(medical,bleedingCoefficient) * _alphaAction) \ No newline at end of file diff --git a/addons/pharma/functions/fnc_getBloodVolumeChange.sqf b/addons/pharma/functions/fnc_getBloodVolumeChange.sqf index dce7c3421..c781e6f1e 100644 --- a/addons/pharma/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/pharma/functions/fnc_getBloodVolumeChange.sqf @@ -20,7 +20,8 @@ params ["_unit", "_deltaT", "_syncValues"]; private _bloodLoss = [_unit] call EFUNC(pharma,getBloodLoss); -private _bloodVolumeChange = -_deltaT * _bloodLoss; +private _internalBleeding = GET_INTERNAL_BLEEDING(_unit); +private _bloodVolumeChange = -_deltaT * (_bloodLoss + _internalBleeding); if (!isNil {_unit getVariable [QACEGVAR(medical,ivBags),[]]}) then { private _bloodBags = _unit getVariable [QACEGVAR(medical,ivBags), []]; From fcebc8c431b2dc571994fbdf3fab93227e7006a6 Mon Sep 17 00:00:00 2001 From: Blue Date: Fri, 3 Feb 2023 20:35:54 +0100 Subject: [PATCH 4/4] Fix pneumothoraxDamageThreshold being ignored --- addons/breathing/XEH_preInit.sqf | 2 +- addons/breathing/functions/fnc_handlePulmoHit.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/breathing/XEH_preInit.sqf b/addons/breathing/XEH_preInit.sqf index 8b6c8a0e8..10458ac84 100644 --- a/addons/breathing/XEH_preInit.sqf +++ b/addons/breathing/XEH_preInit.sqf @@ -185,7 +185,7 @@ PREP_RECOMPILE_END; "SLIDER", [LLSTRING(PNEUMOTHORAX_DAMAGE_THRESHOLD), LLSTRING(PNEUMOTHORAX_DAMAGE_THRESHOLD_DESCRIPTION)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)], - [0, 1, 0.4, 1], + [0, 1, 0.4, 2], true ] call CBA_Settings_fnc_init; diff --git a/addons/breathing/functions/fnc_handlePulmoHit.sqf b/addons/breathing/functions/fnc_handlePulmoHit.sqf index 220f81007..b5d0d1076 100644 --- a/addons/breathing/functions/fnc_handlePulmoHit.sqf +++ b/addons/breathing/functions/fnc_handlePulmoHit.sqf @@ -25,7 +25,7 @@ if (!(GVAR(enable)) || !(_bodyPart isEqualTo "Body") || !(_ammo isKindOF "BulletBase")) exitWith {}; //Other mods can utilise KAT_Pneumothorax_Exclusion variable to prevent Pneumothorax from happening -if ((_damage < GVAR(pneumothoraxDamageThreshold)) || (GVAR(pneumothorax) isEqualTo 0) || (_unit getVariable ["KAT_Pneumothorax_Exclusion", false])) exitWith {}; +if ((_damage < GVAR(pneumothoraxDamageThreshold)) || (_unit getVariable ["KAT_Pneumothorax_Exclusion", false])) exitWith {}; private _hemo = _unit getVariable [QGVAR(hemopneumothorax), false]; private _tension = _unit getVariable [QGVAR(tensionpneumothorax), false];