diff options
| author | briaguya <70942617+briaguya-ai@users.noreply.github.com> | 2024-12-21 10:08:48 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-21 08:08:48 -0700 |
| commit | ff2458128126fa8bb4b4c028c8b3fe627e35c33d (patch) | |
| tree | b1808eaa74d4b4f58208c66bd38dd81331d1e6d9 /soh/src/code | |
| parent | 6fb974bfebc11bcfdb4827e7239c63f9ee2d7bcc (diff) | |
Fix actor inits happening too early (#4742)
* fix dogs not running
* clean up kak gs fix
* clean up scrub leader fix
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_scene.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/soh/src/code/z_scene.c b/soh/src/code/z_scene.c index 207a7b7d0..2ce88cc04 100644 --- a/soh/src/code/z_scene.c +++ b/soh/src/code/z_scene.c @@ -33,6 +33,10 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) { return objectCtx->num - 1; } + +// SOH [Port] Track when objects are first loaded for a scene +static u8 sObjectFirstUpdateSkippedForScene = false; + void Object_InitBank(PlayState* play, ObjectContext* objectCtx) { PlayState* play2 = play; // Needs to be a new variable to match (possibly a sub struct?) size_t spaceSize; @@ -75,6 +79,8 @@ void Object_InitBank(PlayState* play, ObjectContext* objectCtx) { objectCtx->mainKeepIndex = Object_Spawn(objectCtx, OBJECT_GAMEPLAY_KEEP); gSegments[4] = VIRTUAL_TO_PHYSICAL(objectCtx->status[objectCtx->mainKeepIndex].segment); + + sObjectFirstUpdateSkippedForScene = false; } void Object_UpdateBank(ObjectContext* objectCtx) { @@ -83,6 +89,12 @@ void Object_UpdateBank(ObjectContext* objectCtx) { RomFile* objectFile; size_t size; + // SOH [Port] Skip the first object load after scene init so that actors have their init delayed by one frame + // This seems to mostly if not nearly resolve actors that depend on console DMA requests ending later + if (!sObjectFirstUpdateSkippedForScene) { + sObjectFirstUpdateSkippedForScene = true; + return; + } for (i = 0; i < objectCtx->num; i++) { if (status->id < 0) { |
