balakethelock / SuperWoW

1.12.1 WoW client mod that expands on API functionalities
Other
31 stars 2 forks source link

[BUG] Uncertainty about GetContainerItemInfo() change to return number of charges #3

Open veechs opened 2 months ago

veechs commented 2 months ago

Describe the bug When I call GetContainerItemInfo on an item that has charges, such as Manual Crowd Pummeler or Taming Rod, I receive 1 as the itemCount, even though the SuperWoW docs seem to indicate it should be the number of charges instead. Please let me know if I'm misunderstanding the expected behavior.

To Reproduce Steps to reproduce the behavior:

  1. Add Taming Rod to your inventory
  2. Call GetContainerItemInfo(<bagNum>, <slotNum>)
  3. Observe that the return values are: Interface\Icons\Ability_Hunter_BestTaming, 1, nil, -1, nil

Expected behavior I think it's supposed to return Interface\Icons\Ability_Hunter_BestTaming, 3, nil, -1, nil with SuperWoW loaded.

Additional context I've verified that SuperWoW is active, since the CombatLogAdd function exists. This is on a vanilla 1.12 client (not Turtle WoW) with VanillaFixes and nampower loaded, connecting to a private vmangos server.

balakethelock commented 2 months ago

Indeed, items with charges fall into two categories, there are items that on running out of charges, the item with disappear (like tea with sugar or wizard oil) which are the ones working with this lua function at the moment. In the future I will make it also work with the 2nd category (item stays in inventory unusable after it runs out of charges)

veechs commented 2 months ago

Thanks for the explanation! I just tested with Wizard Oil and Tea With Sugar and they are indeed returning charge counts. It might be good to update the documentation to note that charges are returned as negative numbers.