(10-23-2017, 05:15 PM)xoft Wrote: Yes, it is possible to register hooks that way, and your [...]
Thanks for the detailed description
I'm really fond of Cuberite, it's a wonderful project, and I can see that it has passionate devs.
I can see where the problem would arise. Would I be correct in assuming that setting hooks outside of any function, in the global scope, would always be safe from this problem only provided that an anonymous function is passed as the function argument? e.g.:
cPluginManager.AddHook(cPluginManager.HOOK_WHATEVER, function(...) --[[...]] end)
Instead of:
cPluginManager.AddHook(cPluginManager.HOOK_WHATEVER, HookWhateverHandler)