Skip to content

Commit

Permalink
Fix bugs when non-mssb game plays with game mode
Browse files Browse the repository at this point in the history
the tagset codes would get injected for mgtt lol
  • Loading branch information
LittleCoaks committed Mar 5, 2024
1 parent dfdc2c8 commit 19b22c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/Core/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,9 @@ void SetTagSet(std::optional<TagSet> tagset, bool netplay)

bool isTagSetActive(std::optional<bool> netplay)
{
if (!GameSupportsTagSets())
return false;

if (!netplay.has_value())
netplay = NetPlay::IsNetPlayRunning();

Expand All @@ -1808,6 +1811,9 @@ bool isNetplay()

std::optional<std::vector<std::string>> GetTagSetGeckoString()
{
if (!GameSupportsTagSets())
return std::nullopt;

std::optional<TagSet> tagset_active = GetActiveTagSet(NetPlay::IsNetPlayRunning());

if (!tagset_active.has_value())
Expand All @@ -1816,6 +1822,14 @@ std::optional<std::vector<std::string>> GetTagSetGeckoString()
return tagset_active.value().gecko_codes_string();
}

bool GameSupportsTagSets()
{
if (mGameBeingPlayed == GameName::MarioBaseball)
return true;
else
return false;
}

std::optional<u32> getGameFreeMemory()
{
switch (mGameBeingPlayed) {
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ void SetTagSet(std::optional<TagSet> tagset, bool netplay);
bool isTagSetActive(std::optional<bool> netplay = std::nullopt);
bool isNetplay();
std::optional<std::vector<std::string>> GetTagSetGeckoString();
bool GameSupportsTagSets();

// Helper function for the Gecko loader expansion
std::optional<u32> getGameFreeMemory();
Expand Down

0 comments on commit 19b22c1

Please sign in to comment.