Справочник › Справочник функций › Conditions

Conditions.talent.treeExists

зависимость

Как вызывать

Conditions.talent.treeExists(value, cache)

Запишите зависимость Conditions.talent.treeExists и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.

Что делает

Checks that a talent condition's tree index exists on this client, using the cached platform talent tree count.

Аргументы

ИмяТипЧто делает
valuetableCondition settings with a numeric tree field.
cachetable | nilEvaluation-pass cache passed to getCached, or nil to read directly.

Возвращает

1boolean | nilTrue when value.tree is within the tree count, otherwise nil.
2string | nilReason for nil: the tree count's reason, or talent-tree-unavailable.

Издания

Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.

Не читает игровой API напрямую.

Как его вызывает аддон

Зависимости

Исходный код

Conditions/talent.lua, строка 652. В игре только для чтения; «Дублировать» создаёт редактируемую копию.

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

Назад: Справочник функций