mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
Returns true/false for in/out of range, nil when the check does not apply (rangeless spell, or unresolvable spell/unit). spellIdentifier accepts a spellID, link, or spellbook name; targetUnit is a unit token. Backed by the engine's own geometric range core FUN_006E47B0 -- the same test the action-button range coloring uses (Script_IsActionInRange to FUN_004E56F0 to FUN_006E4440 to FUN_006E47B0). It derives the spell min/max range via FUN_006E3480 (which folds in the target's bounding radius AND applies the range SpellMod op 5, so range-extending talents/items like Hawk Eye and Nature's Reach count) then compares center-to-center distance, so the boundary matches the client exactly, melee and min-range spells included. We call the pure core rather than FUN_006E4440: that wrapper also gates on target type and folds range-not-applicable into the same truthy return as in-range, so it cannot yield a clean true/false/nil. The core is range-only, matching retail (ignores line of sight; does not reject wrong-faction targets, documented). Positions are guarded via Unit::Position::Read before the engine call, which dereferences the GetPosition result without a null check. Adds Offsets::FUN_SPELL_RANGE_CHECK (0x006E47B0) with derivation notes, plus API.md and README entries.