Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions soh/soh/Enhancements/mods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,28 @@ void RegisterFreezeTime() {
});
}

/// Clears the cutscene pointer to a value safe for wrong warps.
void RegisterClearCutscenePointer() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>([]() {
if (!gPlayState) return;
if (CVarGetInteger("gClearCutscenePointer", 0)) {
static uint32_t null_cs[] = {0, 0};
gPlayState->csCtx.segment = &null_cs;
CVarSetInteger("gClearCutscenePointer", 0);
}
});
}

void RegisterSafeWrongWarp() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnTransitionEnd>([](int32_t sceneNum) {
if (!gPlayState) return;
if (CVarGetInteger("gSafeWrongWarps", 0) && (sceneNum == 17 || sceneNum == 18 || sceneNum == 19 || sceneNum == 21)) {
static uint32_t null_cs[] = {0, 0};
gPlayState->csCtx.segment = &null_cs;
}
});
}

/// Switches Link's age and respawns him at the last entrance he entered.
void RegisterSwitchAge() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>([]() {
Expand Down Expand Up @@ -559,6 +581,8 @@ void InitMods() {
RegisterInfiniteISG();
RegisterUnrestrictedItems();
RegisterFreezeTime();
RegisterClearCutscenePointer();
RegisterSafeWrongWarp();
RegisterSwitchAge();
RegisterOcarinaTimeTravel();
RegisterAutoSave();
Expand Down
2 changes: 2 additions & 0 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,8 @@ void DrawCheatsMenu() {
UIWidgets::Tooltip("This syncs the ingame time with the real world time");
UIWidgets::PaddedEnhancementCheckbox("No ReDead/Gibdo Freeze", "gNoRedeadFreeze", true, false);
UIWidgets::Tooltip("Prevents ReDeads and Gibdos from being able to freeze you with their scream");
UIWidgets::PaddedEnhancementCheckbox("Safe Wrong Warps", "gSafeWrongWarps", true, false);
UIWidgets::Tooltip("Wrong Warps using blue warps will never softlock");

{
static int32_t betaQuestEnabled = CVarGetInteger("gEnableBetaQuest", 0);
Expand Down