mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Simplify condition checking in canTreat.
This commit is contained in:
parent
69e0ebf107
commit
97082e4ce3
@ -39,19 +39,16 @@ if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exi
|
||||
_locations = getArray (_config >> "treatmentLocations");
|
||||
|
||||
_return = true;
|
||||
if (isText (_config >> "Condition")) then {
|
||||
_condition = getText(_config >> "condition");
|
||||
if (_condition != "") then {
|
||||
if (isnil _condition) then {
|
||||
_condition = compile _condition;
|
||||
} else {
|
||||
_condition = missionNamespace getvariable _condition;
|
||||
};
|
||||
if (typeName _condition == "BOOL") then {
|
||||
_return = _condition;
|
||||
} else {
|
||||
_return = [_caller, _target, _selectionName, _className] call _condition;
|
||||
};
|
||||
if (getText (_config >> "condition") != "") then {
|
||||
if (isnil _condition) then {
|
||||
_condition = compile _condition;
|
||||
} else {
|
||||
_condition = missionNamespace getvariable _condition;
|
||||
};
|
||||
if (typeName _condition == "BOOL") then {
|
||||
_return = _condition;
|
||||
} else {
|
||||
_return = [_caller, _target, _selectionName, _className] call _condition;
|
||||
};
|
||||
};
|
||||
if (!_return) exitwith {false};
|
||||
|
Loading…
Reference in New Issue
Block a user