Thread: 2.6 Update
View Single Post
09/21/16, 09:18 AM   #23
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
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:
  1. function zo_callLater(func, ms)
  2.     local id = ZO_CallLaterId
  3.     local name = "CallLaterFunction"..id
  4.     ZO_CallLaterId = ZO_CallLaterId + 1
  5.  
  6.     EVENT_MANAGER:RegisterForUpdate(name, ms,
  7.         function()
  8.             EVENT_MANAGER:UnregisterForUpdate(name)
  9.             func(id)
  10.         end)
  11.     return id
  12. end
  Reply With Quote