Closed shooter-z closed 1 year ago
I'd complained about this quirk of RegisterOnceFrameEventAndCallback a while back - will probe.
The proper fix is just to have that function only compare the number of values it was initially supplied rather than the number of values supplied in the event payload:
diff --git a/Interface/SharedXML/EventUtil.lua b/Interface/SharedXML/EventUtil.lua
index 7225d817..15b9d430 100644
--- a/Interface/SharedXML/EventUtil.lua
+++ b/Interface/SharedXML/EventUtil.lua
@@ -64,7 +64,7 @@ function EventUtil.RegisterOnceFrameEventAndCallback(frameEvent, callback, ...)
local handle = nil;
local requiredEventArgs = SafePack(...);
local CallbackWrapper = function(callbackHandlerID, ...)
- for i = 1, select("#", ...) do
+ for i = 1, requiredEventArgs.n do
if select(i, ...) ~= requiredEventArgs[i] then
return;
end
This should be fixed in an upcoming (likely next) build.
Resolved in 10.1.0.49092.
Sadly, the issue still remains. While your fix was implemented, and by itself would be enough, at the same time new nil parameter was added to RegisterOnceFrameEventAndCallback call from ContinueOnAddOnLoaded, and when safepacked it bumps requiredEventArgs.n to 2 which... again causes early exit on the same check that the original issue.
I'll re-complain :)
This should be absolutely 100% fixed for real in 10.1.0.49190.
Confirmed fixed.
PTR 10.1, build 48898
EventUtil.ContinueOnAddOnLoaded("ADDON_LOADED", function() print("ContinueOnAddOnLoaded") end, "Blizzard_EventTrace")
does not execute its callback. ADDON_LOADED returns additional bool arg2, and since ContinueOnAddOnLoaded only passes event, callback and addon name to RegisterOnceFrameEventAndCallback , there is no arg2 to compare and test inside callback wrapper fails preventing callback from being executed. We either need a way to pass additional params to ContinueOnAddOnLoaded, or it itself needs to pass false as optional arg2 to RegisterOnceFrameEventAndCallback.