Llamar como
Conditions.spatial.rcf(unit)
Registra la dependencia Conditions.spatial.rcf y después llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa el objeto tú mismo.
Qué hace
Returns the LibRangeCheck-3.0 range estimate for a unit as minimum and maximum yards. It is neither cached nor protected itself; the distance conditions call it through getCached or protectedRead.
Argumentos
| Nombre | Tipo | Qué hace |
|---|---|---|
unit | string | Unit token, such as "target". |
Retornos
| 1 | number | nil | Minimum distance in yards, or nil when no range is known. |
|---|---|---|
| 2 | number | nil | Maximum distance in yards, or nil when the unit is beyond every checked range or no range is known. |
Ediciones
Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar usa una alternativa o devuelve nil con un motivo.
No lee directamente ninguna API del juego.
Ejemplo
-- needs the dependency Conditions.spatial.rcf
local ok, minRange, maxRange = pcall(Functions.cache.getCached, cache, Conditions.spatial.rcf, "target")
if not ok or maxRange == nil then return nil, "range-unavailable" end
return maxRange <= 8Dependencias
RangeCheck(builtin:Conditions/spatial.lua:RangeCheck)
Código fuente
Conditions/spatial.lua, línea 53. Solo lectura en el juego; Duplicar crea una copia editable.
Conditions.spatial.rcf(unit)
return RangeCheck:GetRange(unit)