mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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.
This commit is contained in:
parent
7c5bec50ef
commit
3f0b152fe9
1 changed files with 11 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue