diff options
| author | Philip Dubé <159546+serprex@users.noreply.github.com> | 2026-09-19 14:00:06 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-19 14:00:06 +0000 |
| commit | 27a66925bfa80cdff0583b9434657ed8842102db (patch) | |
| tree | d5355ceca6b5ae9a5e303e6fb38d0cb9d61735d3 /soh/src/code | |
| parent | 2bc50f6056338e4398a894ec8bee6d24f8c8dca1 (diff) | |
Add restoration for hookshot as child to softlock (#7219)
Requested for speedrun mode
Also hookify more enemy rando stuff while I'm in the neighbourhood
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_actor.c | 15 | ||||
| -rw-r--r-- | soh/src/code/z_en_item00.c | 7 |
2 files changed, 4 insertions, 18 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 5f309948c..77c5abce3 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -17,6 +17,7 @@ #include "soh/ActorDB.h" #include "soh/OTRGlobals.h" +#include "soh/ShipUtils.h" #include <string.h> #include <stdlib.h> @@ -3346,11 +3347,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos return NULL; } - objBankIndex = Object_GetIndex(&gPlayState->objectCtx, dbEntry->objectId); - - if (objBankIndex < 0 && (!gMapLoading || CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0))) { - objBankIndex = 0; - } + objBankIndex = Ship_GetActorSpawnObjectIndex(play, dbEntry->objectId, actorId); if ((objBankIndex < 0) || ((dbEntry->category == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num))) { @@ -3428,13 +3425,7 @@ Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play return NULL; } - // The following enemies break when the parent actor isn't the same as what would happen in authentic gameplay. - // As such, don't assign a parent to them at all when spawned with Enemy Randomizer. - // Gohma (z_boss_goma.c) and the falling platform spawning Stalfos in - // Forest Temple (z_bg_mori_bigst.c) that normally rely on this behaviour are changed when - // Enemy Rando is on so they still work properly even without assigning a parent. - if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) && - (spawnedActor->id == ACTOR_EN_FLOORMAS || spawnedActor->id == ACTOR_EN_PEEHAT)) { + if (!GameInteractor_Should(VB_SET_CHILD_ACTOR_PARENT, true, spawnedActor)) { return spawnedActor; } diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index c9775c60c..e06d8fdcf 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -334,12 +334,7 @@ void EnItem00_SetupAction(EnItem00* this, EnItem00ActionFunc actionFunc) { } void EnItem00_SetObjectDependency(EnItem00* this, PlayState* play, s16 objectIndex) { - // Remove object dependency for Enemy Randomizer and Crowd Control to allow Like-likes to - // drop equipment correctly in rooms where Like-likes normally don't spawn. - if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemies"), 0) || - (CVarGetInteger(CVAR_REMOTE_CROWD_CONTROL("Enabled"), 0))) { - this->actor.objBankIndex = 0; - } else { + if (GameInteractor_Should(VB_ITEM00_REQUIRE_OBJECT, true, this)) { this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, objectIndex); Actor_SetObjectDependency(play, &this->actor); } |
