Skip to content

Commit

Permalink
System: Reload cheats/patches on safe mode toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Oct 18, 2024
1 parent baa9065 commit 57cf0f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1470,9 +1470,14 @@ void System::ApplySettings(bool display_osd_messages)
LoadSettings(display_osd_messages);

// If we've disabled/enabled game settings, we need to reload without it.
if (g_settings.apply_game_settings != old_config.apply_game_settings)
// Also reload cheats when safe mode is toggled, because patches might change.
if (g_settings.apply_game_settings != old_config.apply_game_settings ||
g_settings.disable_all_enhancements != old_config.disable_all_enhancements)
{
UpdateGameSettingsLayer();
if (g_settings.apply_game_settings != old_config.apply_game_settings)
UpdateGameSettingsLayer();
else
Cheats::ReloadCheats(false, true, false, true);
LoadSettings(display_osd_messages);
}

Expand Down

2 comments on commit 57cf0f2

@stenzek
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was working for me, but there was a race with the UI thread that could cause database cheats to not be loaded. Fixed in 6cc350a.

@crashGG
Copy link
Contributor

@crashGG crashGG commented on 57cf0f2 Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the cause of the issue has been found. After restoring the default settings, the problem disappears.
However, a new issue has been discovered. This will appear when the UI language is changed while running a game.

Image

Please sign in to comment.