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

Method OnUpdateHitbox

Sources/Jazz2/Scripting/ScriptActorWrapper.cpp:357–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355 }
356
357 void ScriptActorWrapper::OnUpdateHitbox()
358 {
359 if (_onUpdateHitbox == nullptr || _isDead->Get()) {
360 // Call base implementation if not overriden
361 ActorBase::OnUpdateHitbox();
362 return;
363 }
364
365 asIScriptEngine* engine = _obj->GetEngine();
366 asIScriptContext* ctx = engine->RequestContext();
367
368 ctx->Prepare(_onUpdateHitbox);
369 ctx->SetObject(_obj);
370 std::int32_t r = ctx->Execute();
371 if (r == asEXECUTION_EXCEPTION) {
372 LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.",
373 ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration());
374 }
375
376 engine->ReturnContext(ctx);
377 }
378
379 bool ScriptActorWrapper::OnHandleCollision(std::shared_ptr<ActorBase> other)
380 {

Callers

nothing calls this directly

Calls 3

GetEngineMethod · 0.80
ExecuteMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected