MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / OnHitWall

Method OnHitWall

Sources/Jazz2/Scripting/ScriptActorWrapper.cpp:493–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491 }
492
493 void ScriptActorWrapper::OnHitWall(float timeMult)
494 {
495 if (_onHitWall == nullptr || _isDead->Get()) {
496 return;
497 }
498
499 asIScriptEngine* engine = _obj->GetEngine();
500 asIScriptContext* ctx = engine->RequestContext();
501
502 ctx->Prepare(_onHitWall);
503 ctx->SetObject(_obj);
504 ctx->SetArgFloat(0, timeMult);
505 std::int32_t r = ctx->Execute();
506 if (r == asEXECUTION_EXCEPTION) {
507 LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.",
508 ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration());
509 }
510
511 engine->ReturnContext(ctx);
512 }
513
514 void ScriptActorWrapper::OnAnimationStarted()
515 {

Callers

nothing calls this directly

Calls 3

GetEngineMethod · 0.80
ExecuteMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected