Call as
Core.threat_count_conditions.finite(platform, value)
Record the dependency Core.threat_count_conditions.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
Checks that a threat-count number is readable and finite.
Arguments
| Name | Type | What it does |
|---|---|---|
platform | RMPlatform | Platform whose CanReadValue decides readability. |
value | any | Value to check. |
Returns
| 1 | boolean | True when the value is a readable finite number. |
|---|---|---|
| 2 | string | nil | When false: restricted-value or invalid-threat-count-number. |
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.
Secret values (Retail and Forever)
On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.
How the addon calls it
Core.threat_count_conditions.GetConditionThreatCountlocal valid,issue=finite(platform,minimum)
Source
Core/threat_count_conditions.lua, line 20. Read only in game; Duplicate makes an editable copy.
Core.threat_count_conditions.finite(platform, value)
if not platform:CanReadValue(value) then return false,'restricted-value' end
if type(value)~='number' or value~=value or value>=math.huge or value<=-math.huge then return false,'invalid-threat-count-number' end
return true