Consolidate all Spell.dbc record offsets into Offsets.h

Extend the single-source-of-truth cleanup to the whole Spell.dbc record
layout. 40 local constexpr offset copies across 16 files (spell/, totem/,
lossofcontrol/, macro/, aura/) redefined field offsets that belong in
Offsets.h: name (0x1E0), icon (0x1D4), effect (0xF4), rank (0x204),
effect implicit targets (0x148/0x154), powerType (0x7C), manaCost (0x80),
rangeIndex (0x90), castingTimeIndex (0x48), maxLevel (0x6C), spellLevel
(0x74), manaCostPercent (0x270).

Add the ones Offsets.h lacked as OFF_SPELL_RECORD_* and repoint every
local use to the Offsets:: constant, deleting the duplicates. Purely
mechanical and behavior-preserving -- every local value already matched
the canonical (verified before repointing). SpellIcon.dbc / SpellRange.dbc
sub-record offsets (0x04/0x08) stay local; they are different structs.
This commit is contained in:
Brues
2026-08-07 17:44:01 -05:00
parent 2a7cbf75ca
commit 8a065481b4
17 changed files with 68 additions and 107 deletions
+1 -2
View File
@@ -46,7 +46,6 @@ namespace Macro::Spell {
namespace {
constexpr int OFF_SPELL_RANK = 0x204; // 9-locale char *[9] in Spell.dbc
using MacroSlotToEntry_t = const uint8_t *(__fastcall *)(unsigned slot0Based);
@@ -88,7 +87,7 @@ int __fastcall Script_GetMacroSpell(void *L) {
if (name == nullptr)
return 0;
const char *rank = *reinterpret_cast<const char *const *>(
record + OFF_SPELL_RANK + locale * 4);
record + Offsets::OFF_SPELL_RECORD_RANK + locale * 4);
Game::Lua::PushString(L, name);
// Rank slot is empty for most non-class spells (racials, procs,