Reference › Function reference › Conditions

Conditions.spatial.combatFilter

dependency

Call as

Conditions.spatial.combatFilter(value, cache, unit)

Record the dependency Conditions.spatial.combatFilter, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

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).

Arguments

NameTypeWhat it does
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.

Returns

1boolean | nilTrue when the unit passes; nil when its combat state cannot be read.
2string | nilReason code when the first result is nil.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
UnitAffectingCombatClassic EraTBC AnniversaryClassic progressionForeverRetail

How the addon calls it

Dependencies

Source

Conditions/spatial.lua, line 673. Read only in game; Duplicate makes an editable copy.

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

Back to Function reference