From 3f0b152fe9d64b150bc6876c3069b986b597f209 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 17:53:01 -0700 Subject: [PATCH] fix: return debuff type string from UnitBuff/UnitDebuff/UnitAura The debuffType field (5th return value) was always nil. Now resolves dispel type from Spell.dbc via getSpellDispelType(): returns "Magic", "Curse", "Disease", or "Poison" for debuffs. Enables dispel-focused addons like Decursive and Grid to detect debuff categories. --- src/addons/lua_engine.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/addons/lua_engine.cpp b/src/addons/lua_engine.cpp index 71a916e8..0c40b927 100644 --- a/src/addons/lua_engine.cpp +++ b/src/addons/lua_engine.cpp @@ -379,7 +379,17 @@ static int lua_UnitAura(lua_State* L, bool wantBuff) { if (!iconPath.empty()) lua_pushstring(L, iconPath.c_str()); else lua_pushnil(L); // icon texture path lua_pushnumber(L, aura.charges); // count - lua_pushnil(L); // debuffType + // debuffType: resolve from Spell.dbc dispel type + { + uint8_t dt = gh->getSpellDispelType(aura.spellId); + switch (dt) { + case 1: lua_pushstring(L, "Magic"); break; + case 2: lua_pushstring(L, "Curse"); break; + case 3: lua_pushstring(L, "Disease"); break; + case 4: lua_pushstring(L, "Poison"); break; + default: lua_pushnil(L); break; + } + } lua_pushnumber(L, aura.maxDurationMs > 0 ? aura.maxDurationMs / 1000.0 : 0); // duration lua_pushnumber(L, 0); // expirationTime (would need absolute time) lua_pushnil(L); // caster