View Revisions: Issue #4713

Summary 0004713: Starting new script thread with method is wrong
Revision 27.03.2021 14:28 by stgatilov
Description In order to start a thread in script, you write:
  thread myFunc(param1, param2, param3);
Here myFunc should be a global function.

Using a method of an object as myFunc is also possible.
((((( it is wrong, because it won't receive "this" pointer.))))) --- UPDATE: there is no problem with "this" here!
If you run such a script in debug build, it will have "assertion failed" error.
Such scripts are present "in the wild".
Primary example is "Accountant 2": it has assertion failed on startup in debug build due to line convbelt.script:13.

We should find a way to fix this issue. For example:
(((((1. Make sure that this error crashes release build too, then fix missions.))))) --- UPDATE: this is perfectly valid and specifically supported case!
2. (((((Find some limited case when calling method without this is legal))))), and make sure it is properly supported in all builds.
Revision 27.03.2021 14:25 by stgatilov
Description In order to start a thread in script, you write:
  thread myFunc(param1, param2, param3);
Here myFunc should be a global function.

Using a method of an object as myFunc is also possible.
((((( it is wrong, because it won't receive "this" pointer.))))) --- UPDATE: there is no problem with "this" here!
If you run such a script in debug build, it will have "assertion failed" error.
Such scripts are present "in the wild".
Primary example is "Accountant 2": it has assertion failed on startup in debug build due to line convbelt.script:13.

We should find a way to fix this issue. For example:
(((((1. Make sure that this error crashes release build too, then fix missions.))))) --- no way, this is perfectly valid and specifically supported case!
2. Find some limited case when calling method without this is legal, and make sure it is properly supported in all builds.
Revision 25.12.2017 10:06 by stgatilov
Description In order to start a thread in script, you write:
  thread myFunc(param1, param2, param3);
Here myFunc must be a global function.

Using a method of an object as myFunc is wrong, because it won't receive "this" pointer. Moreover, if you run such a script in debug build, it will crash on assert.
However, such scripts are present "in the wild".
Primary example is "Accountant 2": it crashes on startup in debug build due to error in line convbelt.script:13.

We should find a way to fix this issue. For example:
1. Make sure that this error crashes release build too, then fix missions.
2. Find some limited case when calling method without this is legal, and make sure it is properly supported in all builds.