benilla-re systems structs docs

IsTargetInSpellRange

function · spell · primitive

Address
0x6e47b0 · 178 bytes, up to 0x6e4861
Signature
uint8_t __fastcall (void *caster, void *target, uint32_t id, uint8_t *tooFar)
Meaning
Compares the squared caster-target distance with the spell's squared minimum and maximum range
Confidence
verified, proof one
Finding
spell/checks#range-compare
Test
spell::spell_range_check_difftest

Finding: Range compare in spell: checks

0x6e47b0(caster, target, id, &far) clears far, gets (min, max) from 0x6e3480, and computes d = caster position − target position per axis and s = (dx·dx + dz·dz) + dy·dy at 53-bit precision from the float positions. s < min·min returns 0 with far 0; s > max·max sets far to 1 and returns 0; else 1. Equality passes both bounds. A NaN in either compare passes it, so a NaN distance or bound is in range. An implementation in f64 reproduces it exactly.

The derivation is in the doc.

Callers 2

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.