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

Method OnUpdate

Sources/Jazz2/Scripting/ScriptActorWrapper.cpp:336–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334 }
335
336 void ScriptActorWrapper::OnUpdate(float timeMult)
337 {
338 if (_onUpdate == nullptr || _isDead->Get()) {
339 return;
340 }
341
342 asIScriptEngine* engine = _obj->GetEngine();
343 asIScriptContext* ctx = engine->RequestContext();
344
345 ctx->Prepare(_onUpdate);
346 ctx->SetObject(_obj);
347 ctx->SetArgFloat(0, timeMult);
348 std::int32_t r = ctx->Execute();
349 if (r == asEXECUTION_EXCEPTION) {
350 LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.",
351 ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration());
352 }
353
354 engine->ReturnContext(ctx);
355 }
356
357 void ScriptActorWrapper::OnUpdateHitbox()
358 {

Callers

nothing calls this directly

Calls 3

GetEngineMethod · 0.80
ExecuteMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected