Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical Treatment - Add setting for trained medics to use their own items first #10583

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading