Chame como
Conditions.spatial.combatFilter(value, cache, unit)
Registre a dependência Conditions.spatial.combatFilter e depois chame-a por esse nome. Uma chamada com namespace não passa self: use uma chamada com dois-pontos ou passe o objeto você mesmo.
O que faz
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
| Nome | Tipo | O que faz |
|---|---|---|
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. |
Edições
As funções auxiliares integradas são registradas em todas as edições. O que muda é a API do jogo que elas leem; quando uma está ausente, a função auxiliar recorre a uma alternativa ou retorna nil com um motivo.
- Indisponível nessa edição (o motivo está na dica)
- Só enquanto as alternativas da Blizzard para APIs obsoletas estiverem ativas
| API do jogo | |||||
|---|---|---|---|---|---|
UnitAffectingCombat |
Como o addon a chama
- Contagem por distância (evaluate)
local fighting,combatWhy=combatFilter(value,cache,entity.unit) Conditions.spatial.nameplateDistanceCountlocal fighting,combatWhy=combatFilter(value,cache,unit)
Dependências
booleanRead→Conditions.spatial.booleanRead
Código-fonte
Conditions/spatial.lua, linha 673. Somente leitura no jogo; Duplicar cria uma cópia editável.
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




