Another round of fixes for skip intro and grotto rando (#4253)

This commit is contained in:
Archez 2024-07-25 21:09:45 -04:00 committed by GitHub
commit b81a3dd099
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -18,7 +18,8 @@ void SkipIntro_Register() {
bool shuffleOverworldSpawns = bool shuffleOverworldSpawns =
OTRGlobals::Instance->gRandoContext->GetOption(RSK_SHUFFLE_OVERWORLD_SPAWNS).Is(true); OTRGlobals::Instance->gRandoContext->GetOption(RSK_SHUFFLE_OVERWORLD_SPAWNS).Is(true);
if ((CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Intro"), IS_RANDO) || if ((CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Intro"), IS_RANDO) ||
(IS_RANDO && (adultStart || shuffleOverworldSpawns)) && gSaveContext.cutsceneIndex == 0xFFF1)) { (IS_RANDO && (adultStart || shuffleOverworldSpawns))) &&
gSaveContext.cutsceneIndex == 0xFFF1) {
// Calculate spawn location. Start with vanilla, Link's house. // Calculate spawn location. Start with vanilla, Link's house.
int32_t spawnEntrance = ENTR_LINKS_HOUSE_0; int32_t spawnEntrance = ENTR_LINKS_HOUSE_0;
// If we're not in rando, we can skip all of the below. // If we're not in rando, we can skip all of the below.

View file

@ -142,12 +142,12 @@ s16 Grotto_GetEntranceValueHandlingGrottoRando(s16 nextEntranceIndex) {
nextEntranceIndex = grottoExitList[grottoId]; nextEntranceIndex = grottoExitList[grottoId];
} }
// Get the new grotto id from the next entrance // Get the new grotto id from the next entrance, temp value to override modifying the static one
grottoId = nextEntranceIndex & 0x00FF; s8 tempGrottoId = nextEntranceIndex & 0x00FF;
// Grotto Returns // Grotto Returns
if (nextEntranceIndex >= ENTRANCE_RANDO_GROTTO_EXIT_START && nextEntranceIndex < ENTRANCE_RANDO_GROTTO_EXIT_START + NUM_GROTTOS) { if (nextEntranceIndex >= ENTRANCE_RANDO_GROTTO_EXIT_START && nextEntranceIndex < ENTRANCE_RANDO_GROTTO_EXIT_START + NUM_GROTTOS) {
GrottoReturnInfo grotto = grottoReturnTable[grottoId]; GrottoReturnInfo grotto = grottoReturnTable[tempGrottoId];
// When the nextEntranceIndex is determined by a dynamic exit, // When the nextEntranceIndex is determined by a dynamic exit,
// or set by Entrance_OverrideBlueWarp to mark a blue warp entrance, // or set by Entrance_OverrideBlueWarp to mark a blue warp entrance,
@ -162,7 +162,7 @@ s16 Grotto_GetEntranceValueHandlingGrottoRando(s16 nextEntranceIndex) {
} }
// Grotto Loads // Grotto Loads
} else if (nextEntranceIndex >= ENTRANCE_RANDO_GROTTO_LOAD_START && nextEntranceIndex < ENTRANCE_RANDO_GROTTO_EXIT_START) { } else if (nextEntranceIndex >= ENTRANCE_RANDO_GROTTO_LOAD_START && nextEntranceIndex < ENTRANCE_RANDO_GROTTO_EXIT_START) {
GrottoLoadInfo grotto = grottoLoadTable[grottoId]; GrottoLoadInfo grotto = grottoLoadTable[tempGrottoId];
nextEntranceIndex = grotto.entranceIndex; nextEntranceIndex = grotto.entranceIndex;
} }