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
| Name | Type | What it does |
|---|---|---|
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. |
Returns
| 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. |
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 API | |||||
|---|---|---|---|---|---|
UnitAffectingCombat |
How the addon calls it
- Distance Count (evaluate)
local fighting,combatWhy=combatFilter(value,cache,entity.unit) Conditions.spatial.nameplateDistanceCountlocal fighting,combatWhy=combatFilter(value,cache,unit)
Dependencies
booleanRead→Conditions.spatial.booleanRead
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




