Llamar como
Platform.unit_stat.finite(value)
Registra la dependencia Platform.unit_stat.finite 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 true when value is a number that is neither NaN nor infinite, and false for anything else. Negative numbers, zero and fractions count as finite.
Argumentos
| Nombre | Tipo | Qué hace |
|---|---|---|
value | any | Value to test. |
Retornos
| 1 | boolean | True when value is a finite number; false otherwise. |
|---|
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.
Cómo la llama el addon
Platform.unit_stat.GetUnitStatObservationif not finite(stat) or stat%1~=0 or stat<1 or stat>6 then return nil,'invalid-stat-query' end
Código fuente
Platform/unit_stat.lua, línea 14. Solo lectura en el juego; Duplicar crea una copia editable.
Platform.unit_stat.finite(value)
return type(value)=='number' and value==value and value~=math.huge and value~=-math.huge