Call as
Conditions.spatial.rangeMember(cache, unit, distance)
Record the dependency Conditions.spatial.rangeMember, 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
Decides whether unit is within distance yards from the platform's cached range-check bounds: true when the maximum bound is at or inside distance, false when the minimum bound is beyond it (or equals a nonzero distance), otherwise unavailable.
Arguments
| Name | Type | What it does |
|---|---|---|
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
unit | string | Unit token to check. |
distance | number | Distance in yards. |
Returns
| 1 | boolean | nil | Whether the unit is within distance, or nil when the bounds cannot decide. |
|---|---|---|
| 2 | string | nil | The bounds reader's reason, or range-uncertain. |
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.
It reads no game API directly.
How the addon calls it
Conditions.spatial.nameplateDistanceCountlocal member,why=rangeMember(cache,unit,value.distance)
Dependencies
Functions.cache.getCached→Functions.cache.getCachedFunctions.presentation.compareString→Functions.presentation.compareStringFunctions.presentation.nullable→Functions.presentation.nullableFunctions.presentation.playerize→Functions.presentation.playerizeFunctions.values.compare→Functions.values.compareFunctions.values.isin→Functions.values.isin
Source
Conditions/spatial.lua, line 656. Read only in game; Duplicate makes an editable copy.
Conditions.spatial.rangeMember(cache, unit, distance)
local bounds,why=Functions.cache.getCached(cache,addon.Platform.GetRangeCheckBounds,addon.Platform,unit)
if not bounds then return nil,why end
if bounds.maximum and bounds.maximum<=distance then return true end
if bounds.minimum and (bounds.minimum>distance or bounds.minimum>0 and bounds.minimum==distance) then return false end
return nil,"range-uncertain"