View Single Post
02/14/17, 12:57 AM   #5
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
ESO can at least handle a loop of 500,000 iterations without being noticed by users if there's no output.. I know it, I did it.

I'd like to see the kind of loop requiring a pause in order to do this without the complaints of users having so many addons and after months of investigation by the author..

Here we have :

Originally Posted by BrizonTG
How would I prevent a while loop from crashing the client?
No example, no code snippet, no addon mentionned and a user with a post count of #1.

It can be nothing and anything, and for me the best answer to "how to prevent a while loop from crashing the client" asked by a newbie is "BETTER CODING" , not

Lua Code:
  1. EVENT_MANAGER:RegisterForUpdate(ADDON_NAME, 1, zo_callLater(control:SetHandler("OnUpdate", function() DoSomethingWeird() end, 1)))

It's disclose bad practices.

It's like when your grand'ma ask how to change a registry setting when she just bought Win10. The answer should be adapted. So Yes, the first answer can be accepted, but it's not (for my point of view) the best to give.


Infinite loop just fixes the client
If Lua become unresponsive, C++ crash.



control:RegisterForUpdate and zo_callLater can be interesting but in the long list of things a addon author should use when writing their first addon .. they comes at the very end.

Last edited by Ayantir : 02/14/17 at 12:59 AM.
  Reply With Quote