View Single Post
06/20/23, 10:20 AM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,000
First of all this is wrong:
Code:
-- Check if the INTERACTIVE_WHEEL_MANAGER table exists, otherwise create it
INTERACTIVE_WHEEL_MANAGER = INTERACTIVE_WHEEL_MANAGER or {}
INTERACTIVE_WHEEL_MANAGER either exists or not. You cannot create an empty table and define your own function StartInteraction and expect it to do anything, if it wasn't there before :-)
So this line is useless and leads to errors in the end.
-> You probably did that because there was FISHING_MANAGER or INTERACTIVE_WHEEL_MANAGER before. This was only a compatibility line for old API before Necrom and new API with Necrom (PTS). Now that Necrom is live the FISHING_MANAGER is gone and INTERACTIVE_WHEEL_MANAGER is the one to use.

And for that:
I've added the line "d("[NoFastTravel] Interaction type: " .. tostring(interactionType))" to the function to see if the game is picking up on the interactions or not, and ALL the interaction types are "0", meaning it's not registering ANY interaction at all.
Often the functions used are working too fast and the interactions might not be recognized properly that way (your code is calling the API before server got the info about the interaction).
Try to add a small delay, like try with 0 first to let it run at next frame, and if this doesn ot work try a 10ms or higher delay before calling
local interactionType = GetInteractionType()

-> You can do this by using zo_callLater

But:
I know this cannot work with your overwritten function then as the return true would be missing, as the delayed code is run AFTER that return would be needed.

Code:
INTERACTIVE_WHEEL_MANAGER.StartInteraction = function(...)
--delaying the call to API local interactionType = GetInteractionType() within IsWayshrineInteraction() va zo_callLater will not return anything here, just false, making the code always be skipped! So this would just be a way to test if the delay helps to find the correct interactionType or not at all!
    if IsWayshrineInteraction() then 
	d("[NoFastTravel] Wayshrine interaction intercepted!") -- Test code functionality by seeing if this is printed in chat
        return true -- Disable fast travel for wayshrines
    end

    return OriginalInteract(...)
end
This is just to test IF the delayed interaction test would return a correct value of the wayshrine interaction type. But maybe it always returns 0 and just in a few circumstances is the correct INTERACTION_FAST_TRAVEL then...

In that case you'd have to rely on other ways to detect the wayshrine interaction then and I do not know how.
  Reply With Quote