Thread: 2.6 Update
View Single Post
09/21/16, 11:25 AM   #24
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
Originally Posted by sirinsidiator View Post
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
With the next PTS you won't get the insecure code errors anymore, but your suggestion is reasonable. We can change it.
  Reply With Quote