summaryrefslogtreecommitdiff
path: root/src/00_Core/Actor/ActorManager.cpp
diff options
context:
space:
mode:
authorMike <mikebuntu68@gmail.com>2024-05-04 15:13:35 -0400
committerMike <mikebuntu68@gmail.com>2024-07-20 11:25:27 -0400
commit9266f69aa7b7fb36ba0c9d78f5a194496420e2e9 (patch)
tree5d3fbe676c3de5c513cbcc0217cd7cd6ee34d473 /src/00_Core/Actor/ActorManager.cpp
parenteb75915d3893981e1c5f292d9dad7bbc527ab5df (diff)
Match `ActorManager::DeleteActor`
Diffstat (limited to 'src/00_Core/Actor/ActorManager.cpp')
-rw-r--r--src/00_Core/Actor/ActorManager.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/00_Core/Actor/ActorManager.cpp b/src/00_Core/Actor/ActorManager.cpp
index 472eede2..d2927098 100644
--- a/src/00_Core/Actor/ActorManager.cpp
+++ b/src/00_Core/Actor/ActorManager.cpp
@@ -1,6 +1,5 @@
#include "Actor/ActorManager.hpp"
-void ActorManager::DeleteActor(u32 index, bool param2) {}
void ActorManager::func_ov00_020c3484(ActorRef *ref, Actor *actor, unk32 param3) {}
void ActorManager::Actor_vfunc_10(u32 param1) {}
Actor* ActorManager::FindActorById(u32 id) {}
@@ -18,3 +17,40 @@ void ActorManager::func_ov00_020c3ce8(unk32 param1, unk32 param2) {}
void ActorManager::Actor_vfunc_28() {}
bool ActorManager::ActorTypeIsOneOf(u32 type, ActorTypeId *types) {}
+
+extern void func_ov00_020c3f54(void *, u32 param2);
+
+ARM void ActorManager::DeleteActor(u32 index, bool param2) {
+ if (!param2) {
+ func_ov00_020c3f54(this->mUnk_14, index & 0xffff);
+ this->mActorTable[index]->StopLinkFollow();
+ }
+
+ if (this->mActorTable[index] != NULL) {
+ delete this->mActorTable[index];
+ }
+
+ this->mActorTable[index] = NULL;
+
+ if (param2) {
+ return;
+ }
+
+ this->mNumActors--;
+
+ if (index + 1 != this->mMaxActorIndex) {
+ return;
+ }
+
+ int i = index - 1;
+
+ while (i >= 0) {
+ if (this->mActorTable[i] != NULL) {
+ break;
+ }
+ i--;
+ }
+
+ this->mMaxActorIndex = i + 1 & 0xffff;
+ return;
+}