add [bg]/[nobg] conditional for battleground detection

Uses GetBattlefieldStatus to check whether any battlefield queue
slot is in the "active" state, which indicates the player is
currently inside a battleground instance.
This commit is contained in:
Josh Sachs
2026-04-06 21:05:03 -04:00
parent 97bc74c3b4
commit d863387bce
2 changed files with 20 additions and 0 deletions
+18
View File
@@ -7331,6 +7331,24 @@ CleveRoids.Keywords = {
return IsResting() == nil
end,
bg = function()
for i = 1, MAX_BATTLEFIELD_QUEUES do
if GetBattlefieldStatus(i) == "active" then
return true
end
end
return false
end,
nobg = function()
for i = 1, MAX_BATTLEFIELD_QUEUES do
if GetBattlefieldStatus(i) == "active" then
return false
end
end
return true
end,
stat = function(conditionals)
return Multi(conditionals.stat, function(args)
if type(args) ~= "table" or not args.name then
+2
View File
@@ -150,6 +150,8 @@ local BOOLEAN_CONDITIONALS = {
stopattack = true,
pet = true,
nopet = true,
bg = true,
nobg = true,
}
local requirementCheckFrame = CreateFrame("Frame")