From c439d6213780df715feb6c7773d6f39bad2107a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Mon, 23 Mar 2026 16:27:20 +0000 Subject: Enemy rando: don't mutate ActorEntry (#6400) --- soh/src/code/z_actor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'soh/src/code') diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index e999788a4..f0ca7c0cd 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -3471,7 +3471,7 @@ Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, PlayStat gMapLoading = 1; Actor* ret; - if (GameInteractor_Should(VB_SPAWN_ACTOR_ENTRY, true, actorCtx, actorEntry, play, ret)) { + if (GameInteractor_Should(VB_SPAWN_ACTOR_ENTRY, true, actorCtx, actorEntry, play, &ret)) { ret = Actor_Spawn(actorCtx, play, actorEntry->id, actorEntry->pos.x, actorEntry->pos.y, actorEntry->pos.z, actorEntry->rot.x, actorEntry->rot.y, actorEntry->rot.z, actorEntry->params); } -- cgit v1.2.3 From 4aa6e2ec280de14cecd79cdb3de607d7bc9cf1f3 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Thu, 26 Mar 2026 14:18:01 +0000 Subject: Move retrieval of dbEntry after Actor_Destroy (#6410) Before I had the change back to the placeholder actor id the Dummy Player actors were spawned with, but since we grabbed the actorDB entry before Actor_Destroy was called it didn't matter. Move it and the requisite log statement to after Actor_Destroy. --- soh/src/code/z_actor.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'soh/src/code') diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index f0ca7c0cd..54c33e2cf 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -3491,12 +3491,6 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { // Execute before actor memory is freed GameInteractor_ExecuteOnActorDestroy(actor); - dbEntry = ActorDB_Retrieve(actor->id); - - if (HREG(20) != 0) { - osSyncPrintf("アクタークラス削除 [%s]\n", dbEntry->name); // "Actor class deleted [%s]" - } - if ((player != NULL) && (actor == player->focusActor)) { Player_ReleaseLockOn(player); Camera_ChangeMode(Play_GetCamera(play, Play_GetActiveCamId(play)), 0); @@ -3517,6 +3511,12 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { Audio_StopSfxByPos(&actor->projectedPos); Actor_Destroy(actor, play); + dbEntry = ActorDB_Retrieve(actor->id); + + if (HREG(20) != 0) { + osSyncPrintf("アクタークラス削除 [%s]\n", dbEntry->name); // "Actor class deleted [%s]" + } + newHead = Actor_RemoveFromCategory(play, actorCtx, actor); // #region SOH [ObjectExtension] -- cgit v1.2.3