WeakAuras

WeakAuras

206M Downloads

Alterac Valley being treated as 5-man Instance Size Type

Pixol-WoW opened this issue ยท 5 comments

commented

Description

Bug

Alterac Valley in TBC-Classic is treated as a 5-man dungeon. This activates some of my dungeon WeakAuras in Alterac Valley while disabling my battleground WeakAuras when using the Load by Instance Size Type restrictions.

Details

WeakAuras.InstanceType() returns "party" in Alterac Valley (AV)
WeakAuras.InstanceType() returns "pvp" in Eye of the Storm (EOTS)

Copied directly from Weakauras.lua:

local function GetInstanceTypeAndSize()
  local size, difficulty
  local inInstance, Type = IsInInstance()
  local _, instanceType, difficultyIndex, _, _, _, _, ZoneMapID = GetInstanceInfo()
  if (inInstance) then
    size = Type
    local difficultyInfo = Private.difficulty_info[difficultyIndex]
    if difficultyInfo then
      size, difficulty = difficultyInfo.size, difficultyInfo.difficulty
    else
      if WeakAuras.IsRetail() then
        if size == "arena" then
          if C_PvP.IsRatedArena() and not IsArenaSkirmish() then
            size = "ratedarena"
          end
        elseif size == "pvp" then
          if C_PvP.IsRatedBattleground() then
            size = "ratedpvp"
          end
        end
      end
    end
    return size, difficulty, instanceType, ZoneMapID, difficultyIndex
  end
  return "none", "none", nil, nil, nil
end

function WeakAuras.InstanceType()
  return GetInstanceTypeAndSize(), nil
end

WeakAuras.InstanceType() calls GetInstanceTypeAndSize()
GetInstanceTypeAndSize() calls GetInstanceInfo()

In AV, GetInstanceInfo() returns:

[1]="Alterac Valley",
[2]="pvp", -- instanceType
[3]=2, -- difficultyIndex
[4]="Heroic",
...

In EOTS, GetInstanceInfo() returns:

[1]="Eye of the Storm",
[2]="pvp", -- instanceType
[3]=0, -- difficultyIndex
[4]="",
...

The problem is that AV returns 2 as the third output instead of 0 like EOTS or other BGs. 2 is identified as a party heroic if you go inside the definition of Private.difficulty_info in Types.lua. Because of this, in the GetInstanceTypeAndSize() function of WeakAuras.lua, it enters an if statement that changes the output from "pvp" to "party", treating AV as a 5man dungeon.

Solution

Change the GetInstanceTypeAndSize() function in WeakAuras.lua to account for this recent API bug from GetInstanceInfo (probably caused by Blizzard):

if difficultyInfo then

to

if difficultyInfo and instanceType~="pvp" then

WeakAuras Version

WeakAuras 3.7.1

World of Warcraft Flavor

The Burning Crusade

Tested with only WeakAuras

  • Yes
  • No

Lua Error

No response

Reproduction Steps

  1. Enter Alterac Valley
  2. Create new WeakAura
  3. Go to Load Tab, Enable Instance Size Type: Battleground
  4. Note that it isn't loaded
  5. Change to Instance Size Type: 5 Man Dungeon
  6. Note that it's loaded

Last Good Version

No response

Screenshots

No response

Export String

No response

commented

You can report bugs in wow api at https://github.com/Stanzilla/WoWUIBugs/issues

commented

It's a bug on blizzard api we can't do anything about it

commented

I put the solution right there. I posted it and you closed it before even reading.

edit: Sorry it's not a pull-request, I'm not good with submitting those.

commented

@mrbuds @InfusOnWoW this old report didn't get a proper answer so i wanted to ask, OP posted this workaround solution for blizzard's broken API:
change if difficultyInfo then to if difficultyInfo and instanceType~="pvp" then on line 1490 in Weakauras.lua

this seems to fix the issue and AV is loading correctly on "Battleground" load condition without breaking other stuff (from my limited testing). is there any reason for this fix being rejected?

commented

Well, the fear that it would break anything. In general we tend to stay close to the blizzard api as every time we did so, that turns out to be a bad idea. The instance load option being a good example of exactly that problem.

If you send a PR, we could try that out.