| 228 | } |
| 229 | |
| 230 | void LevelScriptLoader::OnLevelBegin() |
| 231 | { |
| 232 | asIScriptFunction* func = GetMainModule()->GetFunctionByDecl("void onLevelBegin()"); |
| 233 | if (func == nullptr) { |
| 234 | return; |
| 235 | } |
| 236 | |
| 237 | OnBeforeScriptCall(); |
| 238 | asIScriptContext* ctx = GetEngine()->RequestContext(); |
| 239 | |
| 240 | ctx->Prepare(func); |
| 241 | std::int32_t r = ctx->Execute(); |
| 242 | if (r == asEXECUTION_EXCEPTION) { |
| 243 | AS_LOG_EXCEPTION(ctx); |
| 244 | } |
| 245 | |
| 246 | GetEngine()->ReturnContext(ctx); |
| 247 | OnAfterScriptCall(); |
| 248 | } |
| 249 | |
| 250 | void LevelScriptLoader::OnLevelReload() |
| 251 | { |