diff options
| author | Aetias <aetias@outlook.com> | 2025-05-30 18:48:13 +0200 |
|---|---|---|
| committer | Aetias <aetias@outlook.com> | 2025-05-30 18:48:13 +0200 |
| commit | 48d9d68c1032dbf5da12d13c54f6bcdfd9c8a95d (patch) | |
| tree | b68fd44850412a14829a5e84a7e77d8752197560 /src/00_Core | |
| parent | fdb4f5ee3f9e1957ffdc3e175c0eb26b650e0dfa (diff) | |
`ActorSpawner` OK
Diffstat (limited to 'src/00_Core')
| -rw-r--r-- | src/00_Core/Actor/ActorSpawner.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/00_Core/Actor/ActorSpawner.cpp b/src/00_Core/Actor/ActorSpawner.cpp index 60feae90..55cf1a57 100644 --- a/src/00_Core/Actor/ActorSpawner.cpp +++ b/src/00_Core/Actor/ActorSpawner.cpp @@ -33,10 +33,10 @@ extern "C" unk32 GetCardinal(s16 angle); ARM s32 ActorSpawner::Spawn(ActorTypeId type, Vec3p *pos, ActorSpawnOptions *options, ActorRef *ref) { ActorManager *actorManager = gActorManager; u16 maxActors = actorManager->mMaxActors; - Actor **actorSlot = actorManager->mActorTable; - ActorRef actorRef; - actorRef.id = -1; - for (actorRef.index = 0; actorRef.index < maxActors; actorRef.index++, actorSlot++) { + s32 id = -1; + s32 index; + Actor **actorSlot = actorManager->mActorTable; + for (index = 0; index < maxActors; index++, actorSlot++) { if (*actorSlot != NULL) { continue; } @@ -51,7 +51,7 @@ ARM s32 ActorSpawner::Spawn(ActorTypeId type, Vec3p *pos, ActorSpawnOptions *opt } actor->mType = type; (*actorSlot)->mRef.id = actorManager->mNextActorId; - (*actorSlot)->mRef.index = actorRef.index; + (*actorSlot)->mRef.index = index; (*actorSlot)->mUnk_014 = *pos; (*actorSlot)->mUnk_020 = options->mUnk_00; (*actorSlot)->mAngle = options->mAngle; @@ -70,15 +70,15 @@ ARM s32 ActorSpawner::Spawn(ActorTypeId type, Vec3p *pos, ActorSpawnOptions *opt actor2->mPrevPos = *pos; (*actorSlot)->mUnk_010 = gMapManager->GetCourseData_Unk_1c(); (*actorSlot)->mUnk_011 = gMapManager->GetCourseData_Unk_1d(); - u16 nextIndex = actorRef.index + 1; + u16 nextIndex = index + 1; if (actorManager->mMaxActorIndex < nextIndex) { actorManager->mMaxActorIndex = nextIndex; } - actorManager->mCacheEmptyActorIndex = actorRef.index; + actorManager->mCacheEmptyActorIndex = index; - actorRef.id = actorManager->mNextActorId; + id = actorManager->mNextActorId; if (ref != NULL) { - *ref = actorRef; + *ref = ActorRef(id, index); } actorManager->mNextActorId += 1; actorManager->mNumActors += 1; @@ -91,8 +91,8 @@ ARM s32 ActorSpawner::Spawn(ActorTypeId type, Vec3p *pos, ActorSpawnOptions *opt } break; } - if ((actorRef.id == -1) && (ref != NULL)) { + if ((id == -1) && (ref != NULL)) { ref->Reset(); } - return actorRef.id; + return id; } |
