From 19b22c1976279d9c23be6a50eb9db71669d57a5f Mon Sep 17 00:00:00 2001 From: LittleCoaks Date: Tue, 5 Mar 2024 04:05:50 -0500 Subject: [PATCH] Fix bugs when non-mssb game plays with game mode the tagset codes would get injected for mgtt lol --- Source/Core/Core/Core.cpp | 14 ++++++++++++++ Source/Core/Core/Core.h | 1 + 2 files changed, 15 insertions(+) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index bcdbc65017bd..4595f8e33856 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -1790,6 +1790,9 @@ void SetTagSet(std::optional tagset, bool netplay) bool isTagSetActive(std::optional netplay) { + if (!GameSupportsTagSets()) + return false; + if (!netplay.has_value()) netplay = NetPlay::IsNetPlayRunning(); @@ -1808,6 +1811,9 @@ bool isNetplay() std::optional> GetTagSetGeckoString() { + if (!GameSupportsTagSets()) + return std::nullopt; + std::optional tagset_active = GetActiveTagSet(NetPlay::IsNetPlayRunning()); if (!tagset_active.has_value()) @@ -1816,6 +1822,14 @@ std::optional> GetTagSetGeckoString() return tagset_active.value().gecko_codes_string(); } +bool GameSupportsTagSets() +{ + if (mGameBeingPlayed == GameName::MarioBaseball) + return true; + else + return false; +} + std::optional getGameFreeMemory() { switch (mGameBeingPlayed) { diff --git a/Source/Core/Core/Core.h b/Source/Core/Core/Core.h index d9689fbf1aec..56c12e0c639e 100644 --- a/Source/Core/Core/Core.h +++ b/Source/Core/Core/Core.h @@ -254,6 +254,7 @@ void SetTagSet(std::optional tagset, bool netplay); bool isTagSetActive(std::optional netplay = std::nullopt); bool isNetplay(); std::optional> GetTagSetGeckoString(); +bool GameSupportsTagSets(); // Helper function for the Gecko loader expansion std::optional getGameFreeMemory();