Hookify more Entrance Rando handling (#4500)
* Hookify more entrance rando handling * fix bad enums
This commit is contained in:
@@ -738,7 +738,11 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
||||
break;
|
||||
case 24:
|
||||
play->nextEntranceIndex = ENTR_JABU_JABU_ENTRANCE;
|
||||
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
||||
play->nextEntranceIndex = Entrance_OverrideNextIndex(ENTR_JABU_JABU_ENTRANCE);
|
||||
} else {
|
||||
play->nextEntranceIndex = ENTR_JABU_JABU_ENTRANCE;
|
||||
}
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
break;
|
||||
@@ -1304,10 +1308,6 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
|
||||
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (shouldSkipCommand && IS_RANDO) {
|
||||
Entrance_OverrideCutsceneEntrance(cmd->base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "soh/frame_interpolation.h"
|
||||
#include "soh/Enhancements/debugconsole.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
||||
#include <overlays/actors/ovl_En_Niw/z_en_niw.h>
|
||||
#include <overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h>
|
||||
#include "soh/Enhancements/enhancementTypes.h"
|
||||
@@ -182,11 +181,6 @@ void Play_Destroy(GameState* thisx) {
|
||||
play->gameplayFrames = 0;
|
||||
}
|
||||
|
||||
// In ER, remove link from epona when entering somewhere that doesn't support epona
|
||||
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) {
|
||||
Entrance_HandleEponaState();
|
||||
}
|
||||
|
||||
play->state.gfxCtx->callback = NULL;
|
||||
play->state.gfxCtx->callbackParam = 0;
|
||||
SREG(91) = 0;
|
||||
@@ -1867,10 +1861,6 @@ void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) {
|
||||
}
|
||||
|
||||
OTRPlay_SpawnScene(play, sceneNum, spawn);
|
||||
|
||||
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
||||
Entrance_OverrideSpawnScene(sceneNum, spawn);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800C016C(PlayState* play, Vec3f* src, Vec3f* dest) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
@@ -578,13 +577,6 @@ u32 func_80096FE8(PlayState* play, RoomContext* roomCtx) {
|
||||
|
||||
frontRoom = gSaveContext.respawnFlag > 0 ? ((void)0, gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex)
|
||||
: play->setupEntranceList[play->curSpawn].room;
|
||||
|
||||
// In ER, override roomNum to load based on scene and spawn during scene init
|
||||
if (IS_RANDO && gSaveContext.respawnFlag <= 0 &&
|
||||
Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
|
||||
frontRoom = Entrance_OverrideSpawnSceneRoom(play->sceneNum, play->curSpawn, frontRoom);
|
||||
}
|
||||
|
||||
func_8009728C(play, roomCtx, frontRoom);
|
||||
|
||||
return maxRoomSize;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <string.h>
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
||||
#include "soh/Enhancements/randomizer/savefile.h"
|
||||
|
||||
#define NUM_DUNGEONS 8
|
||||
@@ -100,7 +99,7 @@ void Sram_OpenSave() {
|
||||
gSaveContext.entranceIndex = ENTR_DODONGOS_CAVERN_ENTRANCE;
|
||||
break;
|
||||
case SCENE_JABU_JABU_BOSS:
|
||||
gSaveContext.entranceIndex = ENTR_JABU_JABU_BOSS_DOOR;
|
||||
gSaveContext.entranceIndex = ENTR_JABU_JABU_ENTRANCE;
|
||||
break;
|
||||
case SCENE_FOREST_TEMPLE_BOSS:
|
||||
gSaveContext.entranceIndex = ENTR_FOREST_TEMPLE_ENTRANCE;
|
||||
@@ -266,8 +265,4 @@ void Sram_InitSram(GameState* gameState) {
|
||||
Save_Init();
|
||||
|
||||
func_800F6700(gSaveContext.audioSetting);
|
||||
|
||||
// When going from a rando save to a vanilla save within the same game instance
|
||||
// we need to reset the entrance table back to its vanilla state
|
||||
Entrance_ResetEntranceTable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user