Fixed location checking in treatment call

This commit is contained in:
Glowbal 2015-02-22 00:47:14 +01:00
parent ab045e49c8
commit e21046459e

View File

@ -39,17 +39,19 @@ if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exi
_locations = getArray (_config >> "treatmentLocations"); _locations = getArray (_config >> "treatmentLocations");
if ("All" in _locations) exitwith {true};
_return = false; _return = false;
{ if ("All" in _locations) then {
if (_x == "field") exitwith {_return = true;}; _return = true;
if (_x == "MedicalFacility" && {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))}) exitwith {_return = true;}; } else {
if (_x == "MedicalVehicle" && {([vehicle _caller] call FUNC(isMedicalVehicle)) || ([vehicle _target] call FUNC(isMedicalVehicle))}) exitwith {_return = true;}; {
}foreach _locations; if (_x == "field") exitwith {_return = true;};
if (_x == "MedicalFacility" && {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))}) exitwith {_return = true;};
if (_x == "MedicalVehicle" && {([vehicle _caller] call FUNC(isMedicalVehicle)) || ([vehicle _target] call FUNC(isMedicalVehicle))}) exitwith {_return = true;};
}foreach _locations;
};
if !(_return) exitwith {false}; if !(_return) exitwith {false};
// Parse the config for the success callback // Parse the config for the success callback
_callbackSuccess = getText (_config >> "callbackSuccess"); _callbackSuccess = getText (_config >> "callbackSuccess");
if (isNil _callbackSuccess) then { if (isNil _callbackSuccess) then {