Chame como
Conditions.spatial.rcf(unit)
Registre a dependência Conditions.spatial.rcf e depois chame-a por esse nome. Uma chamada com namespace não passa self: use uma chamada com dois-pontos ou passe o objeto você mesmo.
O que faz
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
| Nome | Tipo | O que faz |
|---|---|---|
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. |
Edições
As funções auxiliares integradas são registradas em todas as edições. O que muda é a API do jogo que elas leem; quando uma está ausente, a função auxiliar recorre a uma alternativa ou retorna nil com um motivo.
Não lê nenhuma API do jogo diretamente.
Exemplo
-- 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 <= 8Dependências
RangeCheck(builtin:Conditions/spatial.lua:RangeCheck)
Código-fonte
Conditions/spatial.lua, linha 53. Somente leitura no jogo; Duplicar cria uma cópia editável.
Conditions.spatial.rcf(unit)
return RangeCheck:GetRange(unit)