diff --git a/addons/medical_gui/CfgVehicles.hpp b/addons/medical_gui/CfgVehicles.hpp index f30f9908ce..a304423573 100644 --- a/addons/medical_gui/CfgVehicles.hpp +++ b/addons/medical_gui/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { class ACE_Medical { displayName = CSTRING(Medical); condition = QGVAR(enableSelfActions); - exceptions[] = {"isNotInside", "isNotSitting"}; + exceptions[] = {"isNotInside", "isNotSitting", "isNotSwimming"}; statement = QUOTE([ARR_2(_target,0)] call FUNC(displayPatientInformation)); runOnHover = 1; icon = QPATHTOF(ui\cross.paa); diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index dc7cc1b183..a9c6eca5d7 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -83,6 +83,7 @@ class GVAR(actions) { condition = QUOTE(!([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo))); callbackSuccess = QFUNC(tourniquet); litter[] = {}; + allowedUnderwater = 1; }; class RemoveTourniquet: ApplyTourniquet { displayName = CSTRING(Actions_RemoveTourniquet); @@ -90,6 +91,7 @@ class GVAR(actions) { items[] = {}; condition = QUOTE([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo)); callbackSuccess = QFUNC(tourniquetRemove); + allowedUnderwater = 1; }; // - Splint --------------------------------------------------------------- diff --git a/addons/medical_treatment/functions/fnc_canBandage.sqf b/addons/medical_treatment/functions/fnc_canBandage.sqf index 0908e469b2..c564272583 100644 --- a/addons/medical_treatment/functions/fnc_canBandage.sqf +++ b/addons/medical_treatment/functions/fnc_canBandage.sqf @@ -21,6 +21,9 @@ params ["_medic", "_patient", "_bodyPart", "_bandage"]; +// If patient is swimming, don't allow bandage actions. +if (_patient call EFUNC(common,isSwimming)) exitWith {false}; + // Bandage type and bandage setting XNOR to show only active actions if ((_bandage == "BasicBandage") isEqualTo (GVAR(advancedBandages) != 0)) exitWith {false}; diff --git a/addons/medical_treatment/functions/fnc_canTreat.sqf b/addons/medical_treatment/functions/fnc_canTreat.sqf index f7790e548d..2acaf00dbb 100644 --- a/addons/medical_treatment/functions/fnc_canTreat.sqf +++ b/addons/medical_treatment/functions/fnc_canTreat.sqf @@ -59,4 +59,6 @@ isClass _config }; default {false}; }; +} && { + ((getNumber (_config >> "allowedUnderwater")) == 1) || {!([_medic] call ace_common_fnc_isSwimming)} } diff --git a/addons/medical_treatment/functions/fnc_treatment.sqf b/addons/medical_treatment/functions/fnc_treatment.sqf index b99e703f22..5be8ced1e4 100644 --- a/addons/medical_treatment/functions/fnc_treatment.sqf +++ b/addons/medical_treatment/functions/fnc_treatment.sqf @@ -156,7 +156,7 @@ if (_callbackProgress isEqualTo {}) then { FUNC(treatmentFailure), getText (_config >> "displayNameProgress"), _callbackProgress, - ["isNotInside"] + ["isNotInside", "isNotSwimming"] ] call EFUNC(common,progressBar); true