From aad6cab8964df46774706de4c799a384d972d191 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 19 Oct 2015 01:20:11 -0500 Subject: [PATCH 1/2] #2765 - Fix location check when set to disabled --- addons/medical/ACE_Settings.hpp | 4 ++-- addons/medical/functions/fnc_canTreat.sqf | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index b17610b0e35..02b5375e967 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -154,13 +154,13 @@ class ACE_Settings { category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 3; - values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; + values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)}; }; class GVAR(useLocation_SurgicalKit) { category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 2; - values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; + values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)}; }; class GVAR(useCondition_PAK) { category = CSTRING(Category_Medical); diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index ba6ced04865..60685ee20af 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -11,6 +11,9 @@ * ReturnValue: * Can Treat * + * Example: + * [player, cursorTarget, "Head", "SurgicalKit"] call ace_medical_fnc_canTreat + * * Public: Yes */ @@ -85,10 +88,11 @@ _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isI _val = missionNamespace getvariable _x; if (typeName _val == "SCALAR") then { _return = switch (_val) do { - case 0: {true}; - case 1: _medVeh; - case 2: _medFacility; - case 3: {call _medFacility || call _medVeh}; + case 0: {true}; //AdvancedMedicalSettings_anywhere + case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle + case 2: {call _medFacility}; //AdvancedMedicalSettings_facility + case 3: {(call _medFacility) || {call _medVeh}}; //AdvancedMedicalSettings_vehicleAndFacility + default {false}; //Disabled }; }; }; From cfde11d2fa9c87c67ac1c2a14a657506f8a806cb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 19 Oct 2015 01:45:30 -0500 Subject: [PATCH 2/2] Fix medic treatment location check as well --- addons/medical/functions/fnc_treatment.sqf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index 5e97e31501d..2d0e44d4883 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -100,10 +100,11 @@ if ("All" in _locations) then { _val = missionNamespace getvariable _x; if (typeName _val == "SCALAR") then { _return = switch (_val) do { - case 0: {true}; - case 1: _medVeh; - case 2: _medFacility; - case 3: {call _medFacility || call _medVeh}; + case 0: {true}; //AdvancedMedicalSettings_anywhere + case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle + case 2: {call _medFacility}; //AdvancedMedicalSettings_facility + case 3: {(call _medFacility) || {call _medVeh}}; //AdvancedMedicalSettings_vehicleAndFacility + default {false}; //Disabled }; }; };