View Single Post
02/26/23, 01:53 PM   #12
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
I had read that others notified you about that already so here, once again:
Code:
inventoryUpdateReason == 3
Do not use hardcoded numbers like 3 if there are constants provided by the game already which should be used, like BAG_BACKPACK instead of 1 there exists contants for the INVENTORY_UPDATE_REASON_*.
Code:
INVENTORY_UPDATE_REASON_DEFAULT = 0
INVENTORY_UPDATE_REASON_DURABILITY_CHANGE = 1
INVENTORY_UPDATE_REASON_DYE_CHANGE = 2
INVENTORY_UPDATE_REASON_ITEM_CHARGE = 3
INVENTORY_UPDATE_REASON_PLAYER_LOCKED = 4
INVENTORY_UPDATE_REASON_ARMORY_BUILD_CHANGED = 5
To find the constants check the API documentation for the events/functions where those are used and you'll find the type used in there, defied in [typeHere].
Then search for that type in the same API documentation txt file and you'll see the constants that are available.


It's also possible to use merTorchbug ingame and type /tb to show the global inspector, then change to tab "Constants". It provides a search too.
  Reply With Quote