Skip to content

Commit

Permalink
Medical Treatment - Add setting for trained medics to use their own i…
Browse files Browse the repository at this point in the history
…tems first (#10583)
  • Loading branch information
PabstMirror authored Dec 20, 2024
1 parent 1bbdff6 commit 1180be3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion addons/medical_treatment/functions/fnc_tourniquetRemove.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion addons/medical_treatment/functions/fnc_useItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/medical_treatment/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions addons/medical_treatment/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,9 @@
<Chinesesimp>优先消耗医疗兵装备</Chinesesimp>
<Turkish>İlk Sıhhiyenin Ekipmanı</Turkish>
</Key>
<Key ID="STR_ACE_Medical_Treatment_AllowSharedEquipment_PriorityMedicIfMedic">
<English>Medic's Equipment First [If medic role]</English>
</Key>
<Key ID="STR_ACE_Medical_Treatment_AllowSharedEquipment_PriorityPatient">
<English>Patient's Equipment First</English>
<Czech>Prvně pacientovo vybavení</Czech>
Expand Down

0 comments on commit 1180be3

Please sign in to comment.