diff options
Diffstat (limited to 'soh/src/code/z_actor.c')
| -rw-r--r-- | soh/src/code/z_actor.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 70c7a3233..9c241898f 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1231,14 +1231,20 @@ void Actor_Init(Actor* actor, PlayState* play) { ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { Actor_SetObjectDependency(play, actor); - actor->init(actor, play); - actor->init = NULL; - GameInteractor_ExecuteOnActorInit(actor); + if (GameInteractor_ShouldActorInit(actor)) { + actor->init(actor, play); + actor->init = NULL; - // For enemy health bar we need to know the max health during init - if (actor->category == ACTORCAT_ENEMY) { - actor->maximumHealth = actor->colChkInfo.health; + 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; + } + } else { + actor->init = NULL; + Actor_Kill(actor); } } } @@ -2210,6 +2216,10 @@ void Player_PlaySfx(Actor* actor, u16 sfxId) { // Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &D_801333E0 , &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &freqMultiplier, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } + + if (actor->id == ACTOR_PLAYER) { + GameInteractor_ExecuteOnPlayerSfx(sfxId); + } } void Audio_PlayActorSound2(Actor* actor, u16 sfxId) { @@ -2589,14 +2599,20 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { Actor_SetObjectDependency(play, actor); - actor->init(actor, play); - actor->init = NULL; - GameInteractor_ExecuteOnActorInit(actor); + if (GameInteractor_ShouldActorInit(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; + // For enemy health bar we need to know the max health during init + if (actor->category == ACTORCAT_ENEMY) { + actor->maximumHealth = actor->colChkInfo.health; + } + } else { + actor->init = NULL; + Actor_Kill(actor); } } actor = actor->next; |
