Llamar como
Conditions.spatial.combatFilter(value, cache, unit)
Registra la dependencia Conditions.spatial.combatFilter y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.
Qué hace
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).
Argumentos
| Nombre | Tipo | Qué hace |
|---|---|---|
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. |
Retornos
| 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. |
Ediciones
Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.
- No disponible en esa edición (el motivo aparece en la información emergente)
- Solo mientras estén activas las alternativas de Blizzard para API obsoletas
| API del juego | |||||
|---|---|---|---|---|---|
UnitAffectingCombat |
Cómo la llama el addon
- Recuento por distancia (evaluate)
local fighting,combatWhy=combatFilter(value,cache,entity.unit) Conditions.spatial.nameplateDistanceCountlocal fighting,combatWhy=combatFilter(value,cache,unit)
Dependencias
booleanRead→Conditions.spatial.booleanRead
Código fuente
Conditions/spatial.lua, línea 673. Solo lectura en el juego; Duplicar crea una copia editable.
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




