Call as
Conditions.talent.treeExists(value, cache)
Record the dependency Conditions.talent.treeExists, 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 talent condition's tree index exists on this client, using the cached platform talent tree count.
Arguments
| Name | Type | What it does |
|---|---|---|
value | table | Condition settings with a numeric tree field. |
cache | table | nil | Evaluation-pass cache passed to getCached, or nil to read directly. |
Returns
| 1 | boolean | nil | True when value.tree is within the tree count, otherwise nil. |
|---|---|---|
| 2 | string | nil | Reason for nil: the tree count's reason, or talent-tree-unavailable. |
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
- Primary Talent Tree (evaluate)
local exists,why=treeExists(value,cache);if not exists then return nil,why end - Talent Tree Points (evaluate)
local exists,why=treeExists(value,cache);if not exists then return nil,why end
Dependencies
platform(builtin:Conditions/talent.lua:platform)
Source
Conditions/talent.lua, line 652. Read only in game; Duplicate makes an editable copy.
Conditions.talent.treeExists(value, cache)
local count,reason=addon.getCached(cache,platform.GetTalentTreeCount,platform)
if count==nil then return nil,reason end
if value.tree>count then return nil,'talent-tree-unavailable' end
return true