summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Leggett <chris@leggett.dev>2026-03-21 18:32:43 +0000
committerGitHub <noreply@github.com>2026-03-21 18:32:43 +0000
commitb8634f1d8b3708f6db16d28148fd328f3debb14a (patch)
tree6a8f083ac990c2c200d4efb959bc2e8f0aa5be6c
parent5c8ff765543b80cbdf39cae9b5c0d062a7abb367 (diff)
Fix `numLoaded` leak for Anchor (#6384)
-rw-r--r--soh/soh/Network/Anchor/DummyPlayer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/soh/soh/Network/Anchor/DummyPlayer.cpp b/soh/soh/Network/Anchor/DummyPlayer.cpp
index 9192c3c02..4351e27f0 100644
--- a/soh/soh/Network/Anchor/DummyPlayer.cpp
+++ b/soh/soh/Network/Anchor/DummyPlayer.cpp
@@ -243,4 +243,10 @@ void DummyPlayer_Draw(Actor* actor, PlayState* play) {
}
void DummyPlayer_Destroy(Actor* actor, PlayState* play) {
+ // DummyPlayer Actors are initially spawned as ACTOR_PLAYER, but change their
+ // ID shortly afterwards to ACTOR_EN_OE2. This would cause ACTOR_PLAYER's
+ // ActorDB Entry's `numLoaded` to leak, which is mostly harmless but hits debug
+ // asserts. Set the id back to ACTOR_PLAYER so that `numLoaded` will be decremented
+ // correctly.
+ actor->id = ACTOR_PLAYER;
}