YouArentInAPartyFix
Temporary fix for the "You aren't in a party." spam in battlegrounds, caused by old addons calling SendAddonMessage to "RAID" when in battlegrounds or arenas. This is a bug on Blizzard's part introduced in 3.2.0.
Type /yaiap and it will print out debug text every time an addon triggers the "You aren't in a party." message, best used before joining a battleground.
Sample code for fixing this problem:
function SendAddonMessageToRaid(pre, msg) if GetRealNumRaidMembers() == 0 or GetRealNumPartyMembers() == 0 then return end SendAddonMessage(pre, msg, "RAID") end
Also fixes "You are not in a guild." messages.
if c[chl] and ((GetRealNumRaidMembers() == 0 and GetRealNumPartyMembers() == 0) or IsInGuild() == nil) then
would:
block messages to guild while not in a party/raid
block messages to party/raid while not in a guild
allow messages to raid while only in a party
I'll have to screenshot it next time I see it so I can give the exact wording.
Seems like some addon isn't quite handing the cross-realm instances :)
Since t[loc] and t[chl] would be true and true?
Why not do
local t = {["pvp"] = true, ["arena"] = true}
local c = {["raid"] = true, ["party"] = true}
local function fix(pre, msg, ch, ...)
local _, loc = IsInInstance()
local chl = strlower(ch)
if t[loc] and c[chl] then
if DEBUG == true then
print("|c00ff0000YAIAP|r: prefix = |c0000ff00"..pre.."|r: debugstack = "..debugstack(3, 4, 0))
end
ch = "BATTLEGROUND"
end
old(pre, msg, ch, ...)
end
which says if we're in a pvp instance (BG or Arena), and the channel is RAID or PARTY, then set channel as BATTLEGROUND?