Referencia › Referencia de funciones › Conditions

Conditions.spatial.rcf

dependencia

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

NombreTipoQué hace
unitstringUnit token, such as "target".

Retornos

1number | nilMinimum distance in yards, or nil when no range is known.
2number | nilMaximum 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 <= 8

Dependencias

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)

Volver a Referencia de funciones