Trigger variables sometimes collide
Sometimes, when the same input calls different triggers, their variables conflict. Since triggers use
$2, and that depends on their order of execution, when two triggers are executed but not in the right order, they use variables of the others, which creates a real bug.
#1 Updated by Vincent Le Goff over 3 years ago
- Category set to SharpScript
- Status changed from Open to In Progress
- % Done changed from 0 to 20
After some testing, it appears that the problem comes from several threads running at the same time. Each client being in a separate thread, messages could arrive at the same time. Furthermore, when opening the same world in different tabs, the triggers aren't copied (so the SharpScript engine is one of them, not both, which creates conflicts). The solution would be to use a locking system when executing triggers (or macros/aliases, for that matter). This would also reset the SharpScript engine for triggers being executed.
Please register to edit this issue