From c8feff3f8d9ebd0daecd2f07815669084739487c Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Thu, 13 Feb 2025 18:19:26 +0000 Subject: [PATCH] Moved Eggmanland loading transition fix to a code (#401) --- UnleashedRecomp/patches/resident_patches.cpp | 19 +++++++++++-------- UnleashedRecomp/user/config_def.h | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/UnleashedRecomp/patches/resident_patches.cpp b/UnleashedRecomp/patches/resident_patches.cpp index 45266ac..791b415 100644 --- a/UnleashedRecomp/patches/resident_patches.cpp +++ b/UnleashedRecomp/patches/resident_patches.cpp @@ -27,16 +27,19 @@ PPC_FUNC(sub_824DCF38) ctx.r4.u32 = SWA::eLoadingDisplayType_Arrows; } - if (auto pGameDocument = SWA::CGameDocument::GetInstance()) + if (Config::FixEggmanlandUsingEventGalleryTransition) { - auto stageName = pGameDocument->m_pMember->m_StageName.c_str(); - - if (stageName && strlen(stageName)) + if (auto pGameDocument = SWA::CGameDocument::GetInstance()) { - /* Fix restarting Eggmanland as the Werehog - erroneously using the Event Gallery transition. */ - if (ctx.r4.u32 == SWA::eLoadingDisplayType_EventGallery && !strcmp(stageName, "Act_EggmanLand")) - ctx.r4.u32 = SWA::eLoadingDisplayType_NowLoading; + auto stageName = pGameDocument->m_pMember->m_StageName.c_str(); + + if (stageName && strlen(stageName)) + { + /* Fix restarting Eggmanland as the Werehog + erroneously using the Event Gallery transition. */ + if (ctx.r4.u32 == SWA::eLoadingDisplayType_EventGallery && !strcmp(stageName, "Act_EggmanLand")) + ctx.r4.u32 = SWA::eLoadingDisplayType_NowLoading; + } } } diff --git a/UnleashedRecomp/user/config_def.h b/UnleashedRecomp/user/config_def.h index b42203d..25c924e 100644 --- a/UnleashedRecomp/user/config_def.h +++ b/UnleashedRecomp/user/config_def.h @@ -79,6 +79,7 @@ CONFIG_DEFINE_HIDDEN("Codes", bool, AllowCancellingUnleash, false); CONFIG_DEFINE_HIDDEN("Codes", bool, DisableAutoSaveWarning, false); CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDLCIcon, false); CONFIG_DEFINE_HIDDEN("Codes", bool, DisableDWMRoundedCorners, false); +CONFIG_DEFINE_HIDDEN("Codes", bool, FixEggmanlandUsingEventGalleryTransition, false); CONFIG_DEFINE_HIDDEN("Codes", bool, FixUnleashOutOfControlDrain, false); CONFIG_DEFINE_HIDDEN("Codes", bool, HomingAttackOnJump, false); CONFIG_DEFINE_HIDDEN("Codes", bool, HUDToggleKey, false);