Как вызывать
Conditions.spatial.combatFilter(value, cache, unit)
Запишите зависимость Conditions.spatial.combatFilter и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
Applies the In Combat option of Distance Count to one unit: with the option off every unit passes, with it on the unit must be in combat (UnitAffectingCombat).
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
value | table | The Distance Count condition value; its incombat field turns the filter on. |
cache | table | The evaluation cache the reads go through. |
unit | string | Token of the unit being counted. |
Возвращает
| 1 | boolean | nil | True when the unit passes; nil when its combat state cannot be read. |
|---|---|---|
| 2 | string | nil | Reason code when the first result is nil. |
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
- Недоступно в этом издании (причина — во всплывающей подсказке)
- Только пока включены запасные реализации Blizzard для устаревших функций
| Игровой API | |||||
|---|---|---|---|---|---|
UnitAffectingCombat |
Как его вызывает аддон
- Число в радиусе (evaluate)
local fighting,combatWhy=combatFilter(value,cache,entity.unit) Conditions.spatial.nameplateDistanceCountlocal fighting,combatWhy=combatFilter(value,cache,unit)
Зависимости
booleanRead→Conditions.spatial.booleanRead
Исходный код
Conditions/spatial.lua, строка 673. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
Conditions.spatial.combatFilter(value, cache, unit)
if not value.incombat then return true end
local fighting,why=booleanRead(cache,UnitAffectingCombat,unit)
if fighting==nil then return nil,why end
return fighting




