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

Method OnTileDeactivated

Sources/Jazz2/Scripting/ScriptActorWrapper.cpp:259–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257 }
258
259 bool ScriptActorWrapper::OnTileDeactivated()
260 {
261 if (_onTileDeactivated == nullptr || _isDead->Get()) {
262 return true;
263 }
264
265 asIScriptEngine* engine = _obj->GetEngine();
266 asIScriptContext* ctx = engine->RequestContext();
267
268 ctx->Prepare(_onTileDeactivated);
269 ctx->SetObject(_obj);
270 std::int32_t r = ctx->Execute();
271 bool result;
272 if (r == asEXECUTION_EXCEPTION) {
273 LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.",
274 ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration());
275 result = true;
276 } else {
277 result = (ctx->GetReturnByte() != 0);
278 }
279
280 engine->ReturnContext(ctx);
281
282 return result;
283 }
284
285 void ScriptActorWrapper::OnHealthChanged(ActorBase* collider)
286 {

Callers

nothing calls this directly

Calls 3

GetEngineMethod · 0.80
ExecuteMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected