mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed location checking in treatment call
This commit is contained in:
parent
ab045e49c8
commit
e21046459e
@ -39,17 +39,19 @@ if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exi
|
||||
|
||||
_locations = getArray (_config >> "treatmentLocations");
|
||||
|
||||
if ("All" in _locations) exitwith {true};
|
||||
|
||||
_return = false;
|
||||
{
|
||||
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 ("All" in _locations) then {
|
||||
_return = true;
|
||||
} else {
|
||||
{
|
||||
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};
|
||||
|
||||
|
||||
// Parse the config for the success callback
|
||||
_callbackSuccess = getText (_config >> "callbackSuccess");
|
||||
if (isNil _callbackSuccess) then {
|
||||
|
Loading…
Reference in New Issue
Block a user