Referência › Referência de funções › Conditions

Conditions.spatial.combatFilter

dependência

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

NomeTipoO que faz
valuetableThe Distance Count condition value; its incombat field turns the filter on.
cachetableThe evaluation cache the reads go through.
unitstringToken of the unit being counted.

Retornos

1boolean | nilTrue when the unit passes; nil when its combat state cannot be read.
2string | nilReason 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 jogoClassic EraTBC AnniversaryClassic ProgressionForeverRetail
UnitAffectingCombatClassic EraTBC AnniversaryClassic ProgressionForeverRetail

Como o addon a chama

Dependências

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

Voltar para Referência de funções