From ea0fcb1d74128940f9d1c62b6aa7b1a65e3060d1 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 5 May 2024 16:15:07 -0400 Subject: [PATCH] Match `ActorManager::GetActor` --- src/00_Core/Actor/ActorManager.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/00_Core/Actor/ActorManager.cpp b/src/00_Core/Actor/ActorManager.cpp index 27acf972..e85dd20f 100644 --- a/src/00_Core/Actor/ActorManager.cpp +++ b/src/00_Core/Actor/ActorManager.cpp @@ -183,3 +183,24 @@ Actor* NONMATCH(ActorManager::FindActorById)(s32 id) { return actor; #endif } + +Actor* ActorManager::GetActor(ActorRef *ref) { + Actor *pActor; + u32 alive; + + alive = ref->index; + + if ((s32)alive < 0) { + return NULL; + } + + pActor = this->mActorTable[alive]; + if (pActor != NULL) { + alive = pActor->mAlive; + if (alive != 0 && ref->id == pActor->mId) { + return pActor; + } + } + + return NULL; +}