diff options
| author | Aetias <144526980+AetiasHax@users.noreply.github.com> | 2025-07-25 15:59:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-25 15:59:54 +0200 |
| commit | 8ad6359c7d3c7afcbddd7d450b7fa4b9764255b6 (patch) | |
| tree | 09095f8f36375fe4bb358c163d614ebfbc8fe344 /src/00_Core/Actor/ActorManager.cpp | |
| parent | dda45d5574798dc45a31437f473eaa55b9142e13 (diff) | |
ActorSwitchObject OK (#130)
* Map symbol in Game
* ActorSwitchObject OK
* Mark ActorSwitchObject as complete
* Document `mTrapActors`
* Fix FilterActorBase
* Fix regressions
Diffstat (limited to 'src/00_Core/Actor/ActorManager.cpp')
| -rw-r--r-- | src/00_Core/Actor/ActorManager.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/00_Core/Actor/ActorManager.cpp b/src/00_Core/Actor/ActorManager.cpp index 32983645..a881355e 100644 --- a/src/00_Core/Actor/ActorManager.cpp +++ b/src/00_Core/Actor/ActorManager.cpp @@ -45,17 +45,17 @@ ARM void ActorManager::DeleteActor(u32 index, bool param2) { return; } -ARM void ActorManager::func_ov00_020c3484(ActorRef *ref, ActorManager *actorMgr, unk32 param3) { - ref->Reset(); +ARM ActorRef ActorManager::func_ov00_020c3484(unk32 param3) { + ActorRef ref; if (data_027e103c->mUnk_24 == 0) { - return; + return ref; } q20 minDistance = 0x7fffffff; - Actor **actorIter = actorMgr->mActorTable; + Actor **actorIter = this->mActorTable; u8 unkByte = data_02056be4[data_027e077c.GetUnk0()]; bool unk1 = (unkByte & 1) != 0; - Actor **actorTableEnd = actorIter + actorMgr->mMaxActorIndex; + Actor **actorTableEnd = actorIter + this->mMaxActorIndex; for (; actorIter < actorTableEnd; actorIter++) { Actor *actor = *actorIter; @@ -65,7 +65,7 @@ ARM void ActorManager::func_ov00_020c3484(ActorRef *ref, ActorManager *actorMgr, if ((*actorIter)->IsHitboxTouched(false)) { q20 distance = (*actorIter)->DistanceToLink(); if (distance < minDistance) { - *ref = (*actorIter)->mRef; + ref = (*actorIter)->mRef; minDistance = distance; } } @@ -73,6 +73,7 @@ ARM void ActorManager::func_ov00_020c3484(ActorRef *ref, ActorManager *actorMgr, } } } + return ref; } ARM void ActorManager::Actor_vfunc_10(u32 param1) { @@ -217,39 +218,42 @@ ARM s32 ActorManager::FilterActors(FilterActorBase *filter, ActorList *filteredA return numApplied; } -ARM void ActorManager::FindActorByType(ActorRef *ref, ActorManager *actorMgr, ActorTypeId type) { - ref->Reset(); +ARM ActorRef ActorManager::FindActorByType(ActorTypeId type) { + ActorRef ref; - Actor **actorIter = actorMgr->mActorTable; - Actor **actorTableEnd = actorIter + actorMgr->mMaxActorIndex; + Actor **actorIter = this->mActorTable; + Actor **actorTableEnd = actorIter + this->mMaxActorIndex; for (; actorIter < actorTableEnd; actorIter++) { Actor *actor = *actorIter; if (actor != NULL && actor->mAlive && type == actor->mType) { - *ref = actor->mRef; - return; + ref = actor->mRef; + return ref; } } + return ref; } -ARM void ActorManager::FindNearestActorOfType(ActorRef *ref, ActorManager *actorMgr, ActorTypeId type, Vec3p *pos) { - ref->Reset(); +ARM ActorRef ActorManager::FindNearestActorOfType(ActorTypeId type, Vec3p *pos) { + ActorRef ref; q20 minDistance = 0x7fffffff; - Actor **actorIter = actorMgr->mActorTable; - Actor **actorTableEnd = actorIter + actorMgr->mMaxActorIndex; + Actor **actorIter = this->mActorTable; + Actor **actorTableEnd = actorIter + this->mMaxActorIndex; for (; actorIter < actorTableEnd; actorIter++) { Actor *actor = *actorIter; if (actor != NULL && actor->mAlive && type == actor->mType) { q20 distance = Vec3p_Distance(&actor->mPos, pos); if (distance < minDistance) { - *ref = (*actorIter)->mRef; + ref = (*actorIter)->mRef; minDistance = distance; } } } + + return ref; } ARM bool ActorManager::func_ov00_020c398c(u32 index) { |
