summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorArchez <Archez@users.noreply.github.com>2024-04-19 09:41:04 -0400
committerGitHub <noreply@github.com>2024-04-19 09:41:04 -0400
commit0b8cc71d0d59883304aee2d3287f19bc81da03b7 (patch)
tree205c6fbbc8c7bc77217fa504227edcdd24910112 /soh/src/code
parentced34ab68a3b76cd27f636bd98469e962b7b9d03 (diff)
fix actor init flow with object loading (#3987)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_actor.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c
index c1dc66e23..0accb49d0 100644
--- a/soh/src/code/z_actor.c
+++ b/soh/src/code/z_actor.c
@@ -1220,7 +1220,7 @@ void Actor_Init(Actor* actor, PlayState* play) {
actor->floorBgId = BGCHECK_SCENE;
ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f);
if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
- //Actor_SetObjectDependency(play, actor);
+ Actor_SetObjectDependency(play, actor);
actor->init(actor, play);
actor->init = NULL;
@@ -2548,6 +2548,13 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
Actor_SetObjectDependency(play, actor);
actor->init(actor, play);
actor->init = NULL;
+
+ GameInteractor_ExecuteOnActorInit(actor);
+
+ // For enemy health bar we need to know the max health during init
+ if (actor->category == ACTORCAT_ENEMY) {
+ actor->maximumHealth = actor->colChkInfo.health;
+ }
}
actor = actor->next;
} else if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {