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");
|
_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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user