View Single Post
08/06/21, 05:29 AM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Try to change the function code to this, like siri wrote (first param = self). Could be that my exmaple would not work properly as my first param was the interactType but it actually fileld with the values of "self" instead and thus the check on interactType == INTERACT_TYPE_TRAVEL_TO_LEADER was actually if self == INTERACT_TYPE_TRAVEL_TO_LEADER and thus never was met.

Code:
ZO_PreHook(PLAYER_TO_PLAYER, "AddPromptToIncomingQueue", function(self, interactType)
    if interactType == INTERACT_TYPE_TRAVEL_TO_LEADER then
        return true
    end
end)
Yeah the decline callback function is local but it's code is this:
Lua Code:
  1. local function DeclineCallback()
  2.                             self:RemoveFromIncomingQueue(INTERACT_TYPE_TRAVEL_TO_LEADER)
  3.                         end

So if the first code example above did not work you can try this:
Code:
ZO_PreHook(PLAYER_TO_PLAYER, "AddPromptToIncomingQueue", function(self, interactType)
d("interactType: " .. tostring(interactType)) --just a chat debug line to see if interact type is a number (correct) or a table/userdata (wrong)
    if interactType == INTERACT_TYPE_TRAVEL_TO_LEADER then
        self:RemoveFromIncomingQueue(INTERACT_TYPE_TRAVEL_TO_LEADER) --if self is not working try PLAYER_TO_PLAYER::RemoveFromIncomingQueue(INTERACT_TYPE_TRAVEL_TO_LEADER)
        return true
    end
end)

Last edited by Baertram : 08/06/21 at 05:33 AM.
  Reply With Quote