Originally Posted by sirinsidiator
In my sidTools dev addon I replaced the built in zo_callLater with a custom function where the update callback is unregistered before calling the target function. I did this because in the case of an error in the called function the unregister call will never be reached and the broken function will be called again until the UI is reloaded, which can be highly annoying especially during addon development. This has worked without a problem since I made sidTools almost a year ago, but with the latest PTS patch it started producing insecure code errors because the new crown gem crate related code uses zo_callLater, forcing me to remove the custom zo_callLater function. So please apply the following change which has been tested by me and other addon devs for a year to the base game:
Lua Code:
function zo_callLater(func, ms) local id = ZO_CallLaterId local name = "CallLaterFunction"..id ZO_CallLaterId = ZO_CallLaterId + 1 EVENT_MANAGER:RegisterForUpdate(name, ms, function() EVENT_MANAGER:UnregisterForUpdate(name) func(id) end) return id end
|
With the next PTS you won't get the insecure code errors anymore, but your suggestion is reasonable. We can change it.