| 470 | } |
| 471 | |
| 472 | void ScriptActorWrapper::OnHitCeiling(float timeMult) |
| 473 | { |
| 474 | if (_onHitCeiling == nullptr || _isDead->Get()) { |
| 475 | return; |
| 476 | } |
| 477 | |
| 478 | asIScriptEngine* engine = _obj->GetEngine(); |
| 479 | asIScriptContext* ctx = engine->RequestContext(); |
| 480 | |
| 481 | ctx->Prepare(_onHitCeiling); |
| 482 | ctx->SetObject(_obj); |
| 483 | ctx->SetArgFloat(0, timeMult); |
| 484 | std::int32_t r = ctx->Execute(); |
| 485 | if (r == asEXECUTION_EXCEPTION) { |
| 486 | LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.", |
| 487 | ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration()); |
| 488 | } |
| 489 | |
| 490 | engine->ReturnContext(ctx); |
| 491 | } |
| 492 | |
| 493 | void ScriptActorWrapper::OnHitWall(float timeMult) |
| 494 | { |