Call as
Platform.casting.finite(value)
Record the dependency Platform.casting.finite, 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
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.
Arguments
| Name | Type | What it does |
|---|---|---|
value | any | Value to test. |
Returns
| 1 | boolean | True when value is a finite number; false otherwise. |
|---|
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
Platform.casting.durationSecondsif not finite(starting) or not finite(ending) or starting<0 or ending<=starting then return nil,'invalid-api-result' endPlatform.casting.remainingSecondsif not finite(ending) or ending<0 then return nil,'invalid-api-result' end
Source
Platform/casting.lua, line 15. Read only in game; Duplicate makes an editable copy.
Platform.casting.finite(value)
return type(value)=='number' and value==value and value<math.huge and value>-math.huge