local functions can be called as events #2137
Labels
component:core:scriptengine
Affecting the script engine or the script commands
severity:3-medium
Issues with GM commands, script commands, and other commonly used features
type:bug
Issue is a bug or describes an incorrect behavior that should be fixed
Milestone
since local function names and labels are both stored in the same strdb it is possible to call a local function as if it were an event when it has a name that begins with
On
This affects not just custom events but rather every single event calls (oninit, onlogin, mob death, timers, clock, woe, …) since they all use the same functions
We should either make it illegal or officially support it, which would be a great idea as we could get rid of most labels and use functions everywhere. As syntax for the event string we could use
MyNPC::MyFunction()
so if parentheses are found it is a function call, else it is a normal label call
The text was updated successfully, but these errors were encountered: