Add MQ water lock fix, force it in rando (#6575)

This commit is contained in:
Pepper0ni
2026-06-07 02:35:43 +01:00
committed by GitHub
parent 91769a0e3e
commit 8215b97cb8
2 changed files with 37 additions and 0 deletions
@@ -0,0 +1,26 @@
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/ShipInit.hpp"
extern "C" {
#include "src/overlays/actors/ovl_En_Door/z_en_door.h"
extern PlayState* gPlayState;
}
static constexpr int32_t CVAR_MQ_WATER_LOCK_DEFAULT = 0;
#define CVAR_MQ_WATER_LOCK_FIX_NAME CVAR_ENHANCEMENT("MQWaterLockFix")
#define CVAR_MQ_WATER_LOCK_VALUE CVarGetInteger(CVAR_MQ_WATER_LOCK_FIX_NAME, CVAR_MQ_WATER_LOCK_DEFAULT)
static void OnInitEnDoor(void* refActor) {
EnDoor* enDoor = reinterpret_cast<EnDoor*>(refActor);
if (gPlayState->sceneNum == SCENE_WATER_TEMPLE && ResourceMgr_IsGameMasterQuest() &&
enDoor->actor.params == 22659) {
enDoor->actor.params = 22660;
}
}
static void RegisterMQWaterLockFix() {
COND_ID_HOOK(OnActorInit, ACTOR_EN_DOOR, IS_RANDO || CVAR_MQ_WATER_LOCK_VALUE, OnInitEnDoor);
}
static RegisterShipInitFunc initFunc(RegisterMQWaterLockFix, { CVAR_MQ_WATER_LOCK_FIX_NAME, "IS_RANDO" });
+11
View File
@@ -1042,6 +1042,17 @@ void SohMenu::AddMenuEnhancements() {
"Forces Goron City doors open if you somehow complete Fire Temple without talking to Goron Link "
" and receiving the Goron Tunic."));
AddWidget(path, "Fix MQ Water 1F Lock", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("MQWaterLockFix"))
.PreFunc([](WidgetInfo& info) {
info.options->disabled = IS_RANDO && GameInteractor::IsSaveLoaded(true);
info.options->disabledTooltip = "This setting is forcefully enabled when you are playing a Randomizer.";
})
.Options(CheckboxOptions().Tooltip(
"The second small key lock MQ water is removed before the player can reach it by a shared flag with some "
"Stalfos on the way to Dark Link.\n"
"Enabling this will cause that lock to use a different flag, working as intended."));
AddWidget(path, "Item-related Fixes", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Fix Deku Nut Upgrade", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("DekuNutUpgradeFix"))