Medical Treatment - Improve Medical Actions underwater (#9096)

This commit is contained in:
KJW 2023-05-16 06:47:00 +01:00 committed by GitHub
parent 18074fde43
commit fd3c9c967d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 2 deletions

View File

@ -5,7 +5,7 @@ class CfgVehicles {
class ACE_Medical { class ACE_Medical {
displayName = CSTRING(Medical); displayName = CSTRING(Medical);
condition = QGVAR(enableSelfActions); condition = QGVAR(enableSelfActions);
exceptions[] = {"isNotInside", "isNotSitting"}; exceptions[] = {"isNotInside", "isNotSitting", "isNotSwimming"};
statement = QUOTE([ARR_2(_target,0)] call FUNC(displayPatientInformation)); statement = QUOTE([ARR_2(_target,0)] call FUNC(displayPatientInformation));
runOnHover = 1; runOnHover = 1;
icon = QPATHTOF(ui\cross.paa); icon = QPATHTOF(ui\cross.paa);

View File

@ -83,6 +83,7 @@ class GVAR(actions) {
condition = QUOTE(!([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo))); condition = QUOTE(!([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo)));
callbackSuccess = QFUNC(tourniquet); callbackSuccess = QFUNC(tourniquet);
litter[] = {}; litter[] = {};
allowedUnderwater = 1;
}; };
class RemoveTourniquet: ApplyTourniquet { class RemoveTourniquet: ApplyTourniquet {
displayName = CSTRING(Actions_RemoveTourniquet); displayName = CSTRING(Actions_RemoveTourniquet);
@ -90,6 +91,7 @@ class GVAR(actions) {
items[] = {}; items[] = {};
condition = QUOTE([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo)); condition = QUOTE([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo));
callbackSuccess = QFUNC(tourniquetRemove); callbackSuccess = QFUNC(tourniquetRemove);
allowedUnderwater = 1;
}; };
// - Splint --------------------------------------------------------------- // - Splint ---------------------------------------------------------------

View File

@ -21,6 +21,9 @@
params ["_medic", "_patient", "_bodyPart", "_bandage"]; 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 // Bandage type and bandage setting XNOR to show only active actions
if ((_bandage == "BasicBandage") isEqualTo (GVAR(advancedBandages) != 0)) exitWith {false}; if ((_bandage == "BasicBandage") isEqualTo (GVAR(advancedBandages) != 0)) exitWith {false};

View File

@ -59,4 +59,6 @@ isClass _config
}; };
default {false}; default {false};
}; };
} && {
((getNumber (_config >> "allowedUnderwater")) == 1) || {!([_medic] call ace_common_fnc_isSwimming)}
} }

View File

@ -156,7 +156,7 @@ if (_callbackProgress isEqualTo {}) then {
FUNC(treatmentFailure), FUNC(treatmentFailure),
getText (_config >> "displayNameProgress"), getText (_config >> "displayNameProgress"),
_callbackProgress, _callbackProgress,
["isNotInside"] ["isNotInside", "isNotSwimming"]
] call EFUNC(common,progressBar); ] call EFUNC(common,progressBar);
true true