diff options
| author | Rozelette <Rozelette@users.noreply.github.com> | 2025-05-23 16:05:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-23 14:05:33 -0700 |
| commit | e4448f491eaaf62ecc0aeb49611312e25dded1e2 (patch) | |
| tree | e9f8a39f2423d30e596d257c3e6677094c6fcba1 /soh/src/code | |
| parent | db8440e744d043533c13fc8d6e83cddcd6a0deae (diff) | |
Add ObjectExtension system (#5429)
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_actor.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index ac9e4f3f6..b70408d8f 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -7,6 +7,8 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "objects/object_bdoor/object_bdoor.h" +#include "soh/ObjectExtension/ObjectExtension.h" +#include "soh/ObjectExtension/ActorListIndex.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/enemyrandomizer.h" @@ -2574,7 +2576,11 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { if (play->numSetupActors != 0) { actorEntry = &play->setupActorList[0]; for (i = 0; i < play->numSetupActors; i++) { - Actor_SpawnEntry(&play->actorCtx, actorEntry++, play); + Actor* spawnedActor = Actor_SpawnEntry(&play->actorCtx, actorEntry++, play); + + // #region SOH [ObjectExtension] ActorListIndex tracking + SetActorListIndex(spawnedActor, (s16)i); + // #endregion } play->numSetupActors = 0; GameInteractor_ExecuteOnSceneSpawnActors(); @@ -3352,6 +3358,10 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos return NULL; } + // #region SOH [ObjectExtension] + SetActorListIndex(actor, -1); + // #endregion + assert(dbEntry->numLoaded < 255); dbEntry->numLoaded++; @@ -3497,6 +3507,10 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { newHead = Actor_RemoveFromCategory(play, actorCtx, actor); + // #region SOH [ObjectExtension] + ObjectExtension_Free(actor); + // #endregion + ZELDA_ARENA_FREE_DEBUG(actor); dbEntry->numLoaded--; |
