ArtOfShred/LuiExtended

Fillet Fish at Provisioning Station returns incorrect values (when an entire stack is consumed)

Opened this issue · 0 comments

When filleting fish at the provisioning station and you consume an entire inventory or bank stack - the values consumed display incorrectly. This is due to the provisioning station crafting for fish throwing a million inventory update events in an odd order and throwing off LUIE's indexing function.

TODO: Resolve this when a new PTS copy goes out and I can buy many stacks of fish from the Auction House to test this:

  • Theoretical solution:
  • Add new variables: g_fishStacks = {}, g_rawFishStack = 0, g_perfectRoeStack = 0
  • Create a separate index table by itemLink (g_fishStacks) in the Indexing Functions for each ITEMTYPE_FISH in the player's inventory/bank with a count of 0.
  • When the player opens a provisioning station fill the table for g_fishStacks and the values for rawFishStack and perfectRoeStack by using "GetItemLinkStacks(itemLink)" for each itemLink.
  • When a crafting event happens and the itemId is 33753 pass everything to a separate handler - that compares the before/after values of fish item stacks, the raw "Fish" provisioning material, and Perfect Roe and print the differences with the proper context messages. Ignore any changes for ITEMTYPE_FISH and Perfect Roe (when we fillet fish we always receive 1 raw fish so we don't need to call the printer for handling this multiple times).
  • If the events for provisioning fish work the way I think they might (IE if you fillet a stack of 200 fish - it throws an EVENT_INVENTORY_SINGLE_SLOT_UPDATE 1 time for each individual fish and fish crafted) there needs to be some kind of throttle on this before it fires off, a RegisterForUpdate on a 25 ms delay would probably do the trick).