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.
This commit is contained in:
Christopher Leggett
2026-03-26 14:18:01 +00:00
committed by GitHub
parent 94b650ec67
commit 4aa6e2ec28

View File

@@ -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]