Thread: Taint
View Single Post
01-31-13, 04:02 PM   #1
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 124
Taint

Evening folks

I've said a few times before on these forums that I want to be absolutely certain that I'm not degrading the performance of the game because of a lack of knowledge on my part. I'm hooking the func 'UseContainerItem' so that I can add the optional ability for the user to right-click an item in their inventory (while the Auction House is open, regardless of which tab is being used) and that item will be put up for sale.

As it stands, if you're in the 'Bid' or 'Browse' tab, an unmodified right click will attempt to use or equip the item in question.

Here's the code which I have written to perform this:

Lua Code:
  1. M.HookFunc_UseContainerItem = function()
  2.  
  3.     local origUseContainerItem = UseContainerItem;
  4.  
  5.     UseContainerItem = function(...)
  6.  
  7.         if ( AuctionFrame:IsVisible() and ( not AuctionFrameAuctions:IsVisible() ) ) then
  8.             AuctionFrameTab_OnClick(AuctionFrameTab3);
  9.         end
  10.  
  11.         securecall(origUseContainerItem, ...);
  12.  
  13.     end
  14.  
  15. end

Although it works fine, my primary concern is that my hooking UseContainerItem will cause Blizz code to treat it as unsecure. After the user has sold whatever they're selling, they head out into combat and the problems start.

Although UseContainerItem works fine for me during combat, it appears that it may be tainting ArkInventory. I've not yet tested using ArkInventory, while in combat, without the function loaded though, to be honest.

I've played around with the idea of hooksecurefunc, but I'm not sure that that func can produce the desired result; by the time my post-hook is called, it's already going to be trying to equip the item.

If anyone could offer some advice on this, it would be very much appreciated.

Thanks in advance,


Aanson.
__________________
__________________
  Reply With Quote