| 208 | } |
| 209 | |
| 210 | void LevelScriptLoader::OnLevelLoad() |
| 211 | { |
| 212 | asIScriptFunction* func = GetMainModule()->GetFunctionByDecl("void onLevelLoad()"); |
| 213 | if (func == nullptr) { |
| 214 | return; |
| 215 | } |
| 216 | |
| 217 | OnBeforeScriptCall(); |
| 218 | asIScriptContext* ctx = GetEngine()->RequestContext(); |
| 219 | |
| 220 | ctx->Prepare(func); |
| 221 | std::int32_t r = ctx->Execute(); |
| 222 | if (r == asEXECUTION_EXCEPTION) { |
| 223 | AS_LOG_EXCEPTION(ctx); |
| 224 | } |
| 225 | |
| 226 | GetEngine()->ReturnContext(ctx); |
| 227 | OnAfterScriptCall(); |
| 228 | } |
| 229 | |
| 230 | void LevelScriptLoader::OnLevelBegin() |
| 231 | { |