Reference › Function reference › Conditions

Conditions.hero_talent.validTree

dependency

Call as

Conditions.hero_talent.validTree(value)

Record the dependency Conditions.hero_talent.validTree, 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 value can be a hero talent tree ID: a positive whole number below 2^31.

Arguments

NameTypeWhat it does
valueanyThe value to test.

Returns

1booleanTrue for a valid tree ID.

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

Source

Conditions/hero_talent.lua, line 32. Read only in game; Duplicate makes an editable copy.

Conditions.hero_talent.validTree(value)
    return type(value) == "number" and value == value and value > 0 and value < 2^31 and value % 1 == 0

Back to Function reference