From bd5e9aa2c2c95b1e680bf99bc37e49b42d098688 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 15 May 2026 01:54:16 -0700 Subject: [PATCH] fix(dbc): add SpellRange.MinRange to all expansion layouts application.cpp:438 queries SpellRange.MinRange to populate the spell-range map used by minimum-distance casting checks. None of the four dbc_layouts.json files defined MinRange, so the lookup returned the DBC_FIELD_INVALID sentinel (0xFFFFFFFF); rDbc->getFloat(i, 0xFFFFFFFF) then read out of bounds and returned 0. Minimum-range checks were silently dead on every expansion. Canonical SpellRange.dbc layouts (per spellbook_screen.cpp:71-74): Classic 1.12: 0=ID, 1=MinRange, 2=MaxRange TBC / WotLK: 0=ID, 1=MinRangeFriendly, 2=MinRangeHostile, 3=MaxRangeFriendly, 4=MaxRangeHostile The existing MaxRange values (classic 2, TBC/WotLK 4) follow the 'Hostile' convention; MinRange is wired the same way (1 for Vanilla, 2 for TBC/WotLK). Visible effect: spells with a non-zero minimum range (hunter ranged abilities, Pyroblast, etc.) will now correctly trigger 'You are too close' errors and target-validity checks at the client level. --- Data/expansions/classic/dbc_layouts.json | 1 + Data/expansions/tbc/dbc_layouts.json | 1 + Data/expansions/turtle/dbc_layouts.json | 1 + Data/expansions/wotlk/dbc_layouts.json | 1 + 4 files changed, 4 insertions(+) diff --git a/Data/expansions/classic/dbc_layouts.json b/Data/expansions/classic/dbc_layouts.json index d95e561a..d3041cb4 100644 --- a/Data/expansions/classic/dbc_layouts.json +++ b/Data/expansions/classic/dbc_layouts.json @@ -188,6 +188,7 @@ "Path": 1 }, "SpellRange": { + "MinRange": 1, "MaxRange": 2 }, "SpellVisual": { diff --git a/Data/expansions/tbc/dbc_layouts.json b/Data/expansions/tbc/dbc_layouts.json index 7899f634..f96d74c6 100644 --- a/Data/expansions/tbc/dbc_layouts.json +++ b/Data/expansions/tbc/dbc_layouts.json @@ -231,6 +231,7 @@ "Name": 8 }, "SpellRange": { + "MinRange": 2, "MaxRange": 4 }, "SpellVisual": { diff --git a/Data/expansions/turtle/dbc_layouts.json b/Data/expansions/turtle/dbc_layouts.json index 1218449b..c1b351e6 100644 --- a/Data/expansions/turtle/dbc_layouts.json +++ b/Data/expansions/turtle/dbc_layouts.json @@ -225,6 +225,7 @@ "Name": 8 }, "SpellRange": { + "MinRange": 1, "MaxRange": 2 }, "SpellVisual": { diff --git a/Data/expansions/wotlk/dbc_layouts.json b/Data/expansions/wotlk/dbc_layouts.json index f070509d..9bd48eb5 100644 --- a/Data/expansions/wotlk/dbc_layouts.json +++ b/Data/expansions/wotlk/dbc_layouts.json @@ -247,6 +247,7 @@ "Name": 8 }, "SpellRange": { + "MinRange": 2, "MaxRange": 4 }, "SpellVisual": {