From 1180be3cdb1d5b92425bb4a8a1216bde51817968 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 20 Dec 2024 16:17:33 -0600 Subject: [PATCH] Medical Treatment - Add setting for trained medics to use their own items first (#10583) --- addons/medical_treatment/functions/fnc_tourniquetRemove.sqf | 4 +++- addons/medical_treatment/functions/fnc_useItem.sqf | 4 +++- addons/medical_treatment/initSettings.inc.sqf | 2 +- addons/medical_treatment/stringtable.xml | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf index 80dab5094cf..627d7ecd534 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf @@ -42,7 +42,9 @@ TRACE_1("clearConditionCaches: tourniquetRemove",_nearPlayers); // Add tourniquet item to medic or patient if (_medic call EFUNC(common,isPlayer)) then { - private _receiver = [_patient, _medic, _medic] select GVAR(allowSharedEquipment); + private _allowSharedEquipment = GVAR(allowSharedEquipment); + if (_allowSharedEquipment == 3) then { _allowSharedEquipment = [0, 1] select ([_medic] call FUNC(isMedic)) }; + private _receiver = [_patient, _medic, _medic] select _allowSharedEquipment; [_receiver, "ACE_tourniquet"] call EFUNC(common,addToInventory); } else { // If the medic is AI, only return tourniquet if enabled diff --git a/addons/medical_treatment/functions/fnc_useItem.sqf b/addons/medical_treatment/functions/fnc_useItem.sqf index 2a8583d1533..7f9299872c9 100644 --- a/addons/medical_treatment/functions/fnc_useItem.sqf +++ b/addons/medical_treatment/functions/fnc_useItem.sqf @@ -26,7 +26,9 @@ if (_medic isEqualTo player && {!isNull findDisplay 312}) exitWith { scopeName "Main"; -private _useOrder = [[_patient, _medic], [_medic, _patient], [_medic]] select GVAR(allowSharedEquipment); +private _allowSharedEquipment = GVAR(allowSharedEquipment); +if (_allowSharedEquipment == 3) then { _allowSharedEquipment = [0, 1] select ([_medic] call FUNC(isMedic)) }; +private _useOrder = [[_patient, _medic], [_medic, _patient], [_medic]] select _allowSharedEquipment; { private _unit = _x; diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index 3f30f514faa..b5297e7f34b 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -85,7 +85,7 @@ "LIST", [LSTRING(AllowSharedEquipment_DisplayName), LSTRING(AllowSharedEquipment_Description)], LSTRING(Category), - [[0, 1, 2], [LSTRING(AllowSharedEquipment_PriorityPatient), LSTRING(AllowSharedEquipment_PriorityMedic), ELSTRING(common,No)], 0], + [[0, 1, 3, 2], [LSTRING(AllowSharedEquipment_PriorityPatient), LSTRING(AllowSharedEquipment_PriorityMedic), LSTRING(AllowSharedEquipment_PriorityMedicIfMedic), ELSTRING(common,No)], 0], true ] call CBA_fnc_addSetting; diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index af49f176816..61513ccbd7c 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -971,6 +971,9 @@ 优先消耗医疗兵装备 İlk Sıhhiyenin Ekipmanı + + Medic's Equipment First [If medic role] + Patient's Equipment First Prvně pacientovo vybavení