From e2bb2edb8ab0ea9d2077e4b2236bf605c98de324 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Fri, 4 Apr 2025 10:14:23 -0400 Subject: [PATCH] Fix the start with Master Sword option (#5304) --- soh/soh/Enhancements/randomizer/3drando/hints.cpp | 2 +- soh/soh/Enhancements/randomizer/savefile.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/hints.cpp b/soh/soh/Enhancements/randomizer/3drando/hints.cpp index c55145fcd..8e928185f 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hints.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/hints.cpp @@ -835,7 +835,7 @@ void CreateGanondorfJoke() { void CreateGanondorfHint() { auto ctx = Rando::Context::GetInstance(); if (ctx->GetOption(RSK_GANONDORF_HINT) && !ctx->GetHint(RH_GANONDORF_HINT)->IsEnabled()) { - if (ctx->GetOption(RSK_SHUFFLE_MASTER_SWORD)) { + if (ctx->GetOption(RSK_SHUFFLE_MASTER_SWORD) && ctx->GetOption(RSK_STARTING_MASTER_SWORD).Is(RO_GENERIC_OFF)) { CreateStaticItemHint( RH_GANONDORF_HINT, { RHT_GANONDORF_HINT_LA_ONLY, RHT_GANONDORF_HINT_MS_ONLY, RHT_GANONDORF_HINT_LA_AND_MS }, diff --git a/soh/soh/Enhancements/randomizer/savefile.cpp b/soh/soh/Enhancements/randomizer/savefile.cpp index 4753bb4b4..cb8c7eaef 100644 --- a/soh/soh/Enhancements/randomizer/savefile.cpp +++ b/soh/soh/Enhancements/randomizer/savefile.cpp @@ -107,6 +107,7 @@ void GiveLinksPocketItem() { } void SetStartingItems() { + int startingAge = OTRGlobals::Instance->gRandoContext->GetOption(RSK_SELECTED_STARTING_AGE).Get(); if (Randomizer_GetSettingValue(RSK_STARTING_KOKIRI_SWORD)) Item_Give(NULL, ITEM_SWORD_KOKIRI); if (Randomizer_GetSettingValue(RSK_STARTING_DEKU_SHIELD)) @@ -158,6 +159,13 @@ void SetStartingItems() { if (Randomizer_GetSettingValue(RSK_STARTING_NUTS) && !Randomizer_GetSettingValue(RSK_SHUFFLE_DEKU_NUT_BAG)) { GiveLinkDekuNuts(20); } + if (Randomizer_GetSettingValue(RSK_STARTING_MASTER_SWORD)) { + if (startingAge == RO_AGE_ADULT) { + Item_Give(NULL, ITEM_SWORD_MASTER); + } else { + gSaveContext.inventory.equipment |= 1 << 1; + } + } if (Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { GiveLinkRupees(9001);