| 28 | } |
| 29 | |
| 30 | ScriptAsyncMode::ScriptAsyncMode(HSQUIRRELVM vm) |
| 31 | { |
| 32 | int nparam = sq_gettop(vm) - 1; |
| 33 | if (nparam < 1) { |
| 34 | throw sq_throwerror(vm, "You need to pass a boolean to the constructor"); |
| 35 | } |
| 36 | |
| 37 | SQBool sqasync; |
| 38 | if (SQ_FAILED(sq_getbool(vm, 2, &sqasync))) { |
| 39 | throw sq_throwerror(vm, "Argument must be a boolean"); |
| 40 | } |
| 41 | |
| 42 | this->last_mode = this->GetDoCommandAsyncMode(); |
| 43 | this->last_instance = this->GetDoCommandAsyncModeInstance(); |
| 44 | |
| 45 | this->SetDoCommandAsyncMode(sqasync ? &ScriptAsyncMode::AsyncModeProc : &ScriptAsyncMode::NonAsyncModeProc, this); |
| 46 | } |
| 47 | |
| 48 | void ScriptAsyncMode::FinalRelease() |
| 49 | { |
nothing calls this directly
no test coverage detected