Call as
Platform.health_forecast.providerValue(self, value)
Record the dependency Platform.health_forecast.providerValue, 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
Normalizes one health figure returned by the RealMobHealth provider. Returns the value when it is a readable finite nonnegative number, nil with no reason when it is nil or false (the provider has no figure, so native health can be used instead), or nil with "restricted-value" or "invalid-api-result".
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
value | any | Current or maximum health value from RealMobHealth.GetUnitHealth. |
Returns
| 1 | number | nil | Finite nonnegative health value, or nil when absent or unavailable. |
|---|---|---|
| 2 | string | nil | Reason when the value is unusable; nil when it is valid or simply absent. |
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.
- Not available on that edition (the reason is in the tooltip)
- Only while Blizzard's deprecation fallbacks are on
| Game API | |||||
|---|---|---|---|---|---|
canaccessvalue |
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
Platform.health_forecast.GetHealthForecastProviderObservationlocal value,reason=providerValue(self,current)
Dependencies
finite→Platform.health_forecast.finite
Source
Platform/health_forecast.lua, line 40. Read only in game; Duplicate makes an editable copy.
Platform.health_forecast.providerValue(self, value)
if not self:CanReadValue(value) then return nil,'restricted-value' end
if canaccessvalue and not canaccessvalue(value) then return nil,'restricted-value' end
if value==nil or value==false then return nil end
if not finite(value) or value<0 then return nil,'invalid-api-result' end
return value




