Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

UnitBattlePetType returns zero-indexed values in 10.2 #499

Closed Meorawr closed 7 months ago

Meorawr commented 7 months ago

In patch 10.2 the UnitBattlePetType API appears to now return raw pet types with zero-based indexing (eg. Humanoid pets return 0).

This runs slightly counter to a few things;

  1. The global strings for battle pet type names still use 1-based indexing - eg. BATTLE_PET_NAME_1 = "Humanoid".
  2. The global PET_TYPE_SUFFIX table similarly still uses 1-based indexing.

Currently, the effects of this change can be noticed by summoning a Humanoid battle pet and then targetting it - as the PET_TYPE_SUFFIX table hasn't been adjusted you'll get a script error. For all other pet types, the displayed texture will be incorrect (eg. Flying pets will use the Dragonkin icon).

Seagulls do however have the temperament of dragons, so this may not be that inaccurate.

For the Humanoid case:

Message: Interface/FrameXML/TargetFrame.lua:373: attempt to concatenate field '?' (a nil value)
Time: Fri Nov 10 10:54:25 2023
Count: 1
Stack: Interface/FrameXML/TargetFrame.lua:373: attempt to concatenate field '?' (a nil value)
[string "@Interface/FrameXML/TargetFrame.lua"]:373: in function `CheckBattlePet'
[string "@Interface/FrameXML/TargetFrame.lua"]:154: in function `Update'
[string "@Interface/FrameXML/TargetFrame.lua"]:169: in function `OnEvent'
[string "@Interface/FrameXML/UnitFrame.lua"]:1086: in function <Interface/FrameXML/UnitFrame.lua:1084>
Meorawr commented 7 months ago

Fixed in 10.2.0.52129.