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

Method OnHitFloor

Sources/Jazz2/Scripting/ScriptActorWrapper.cpp:451–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449 }
450
451 void ScriptActorWrapper::OnHitFloor(float timeMult)
452 {
453 if (_onHitFloor == nullptr || _isDead->Get()) {
454 return;
455 }
456
457 asIScriptEngine* engine = _obj->GetEngine();
458 asIScriptContext* ctx = engine->RequestContext();
459
460 ctx->Prepare(_onHitFloor);
461 ctx->SetObject(_obj);
462 ctx->SetArgFloat(0, timeMult);
463 std::int32_t r = ctx->Execute();
464 if (r == asEXECUTION_EXCEPTION) {
465 LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.",
466 ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration());
467 }
468
469 engine->ReturnContext(ctx);
470 }
471
472 void ScriptActorWrapper::OnHitCeiling(float timeMult)
473 {

Callers

nothing calls this directly

Calls 3

GetEngineMethod · 0.80
ExecuteMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected