From 4aa6e2ec280de14cecd79cdb3de607d7bc9cf1f3 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Thu, 26 Mar 2026 14:18:01 +0000 Subject: [PATCH] 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(-) 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]