Page 1 of 1

Document which calls raise events

Posted: Thu Jul 25, 2019 5:24 pm
by Therax
Some but not all API calls can raise events, which may invalidate LuaObjects held by mods. It would be good if the documentation for the API calls indicated whether they raise events, so mod authors can know whether it is necessary to re-validate held references.

Re: Document which calls raise events

Posted: Thu Jul 25, 2019 5:38 pm
by Rseding91
The concept sounds nice but quickly becomes a huge annoyance for us internally as we have to every time we change anything to fire an event or not go over literally all of the Lua API and check which things may get to that logic by any round-about way.

In the end, you should always validate your objects are valid before using them.

Re: Document which calls raise events

Posted: Thu Jul 25, 2019 5:42 pm
by Bilka
Rseding91 wrote: Thu Jul 25, 2019 5:38 pm The concept sounds nice but quickly becomes a huge annoyance for us internally as we have to every time we change anything to fire an event or not go over literally all of the Lua API and check which things may get to that logic by any round-about way.

In the end, you should always validate your objects are valid before using them.
You know that I'm crazy about documentation :p