View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004713 | The Dark Mod | Script/Def | public | 25.12.2017 10:06 | 05.12.2020 12:36 |
Reporter | stgatilov | Assigned To | stgatilov | ||
Priority | low | Severity | minor | Reproducibility | N/A |
Status | assigned | Resolution | open | ||
Product Version | TDM 2.06 | ||||
Target Version | TDM 2.10 | ||||
Summary | 0004713: Starting new script thread with method is wrong | ||||
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. | ||||
Steps To Reproduce | 1. Start debug build of TDM. 2. Start mission "Accountant 2". You'll get assertion failed in Script_Interpreter.cpp on OP_OBJTHREAD case in this line: assert( st->c->value.argSize == func->parmTotal ); | ||||
Additional Information | Note: there is function called callFunctionOn in tdm_util.script, which allows you to create new thread like this: thread callFunctionOn("frob_ignite", child); Here new thread calls child.frob_ignite(); This function does not support passing parameters. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
25.12.2017 10:06 | stgatilov | New Issue | |
25.12.2017 10:09 | stgatilov | Additional Information Updated | View Revisions |
01.07.2018 04:05 | stgatilov | Assigned To | => stgatilov |
01.07.2018 04:05 | stgatilov | Status | new => assigned |
21.03.2020 17:45 | stgatilov | Target Version | => TDM 2.09 |
05.12.2020 12:36 | stgatilov | Target Version | TDM 2.09 => TDM 2.10 |