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

Method OnHitCeiling

Sources/Jazz2/Scripting/ScriptActorWrapper.cpp:472–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

GetEngineMethod · 0.80
ExecuteMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected