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

Fix medical location check when set to disabled for PAK/Surgical #2767

Merged
merged 2 commits into from
Oct 23, 2015
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: 2 additions & 2 deletions addons/medical/ACE_Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 8 additions & 4 deletions addons/medical/functions/fnc_canTreat.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* ReturnValue:
* Can Treat <BOOL>
*
* Example:
* [player, cursorTarget, "Head", "SurgicalKit"] call ace_medical_fnc_canTreat
*
* Public: Yes
*/

Expand Down Expand Up @@ -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
};
};
};
Expand Down
9 changes: 5 additions & 4 deletions addons/medical/functions/fnc_treatment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
};
};
Expand Down