Skip to content

Commit 978a4d0

Browse files
committed
Achievements: Add small check to sound effects playback
1 parent d308ce1 commit 978a4d0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pcsx2/Achievements.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,12 +1142,12 @@ void Achievements::DisplayAchievementSummary()
11421142
ImGuiFullscreen::AddNotification(
11431143
"achievement_summary", ACHIEVEMENT_SUMMARY_NOTIFICATION_TIME, std::move(title), std::move(summary), std::move(icon));
11441144
}
1145-
});
1145+
});
11461146
}
11471147

11481148
if (EmuConfig.Achievements.SoundEffects && EmuConfig.Achievements.InfoSound)
11491149
Common::PlaySoundAsync(
1150-
(EmuConfig.Achievements.InfoSoundName.empty()
1150+
(EmuConfig.Achievements.InfoSoundName.empty() || !FileSystem::FileExists(EmuConfig.Achievements.InfoSoundName.c_str())
11511151
? Path::Combine(EmuFolders::Resources, DEFAULT_INFO_SOUND_NAME)
11521152
: EmuConfig.Achievements.InfoSoundName).c_str()
11531153
);
@@ -1203,7 +1203,7 @@ void Achievements::HandleUnlockEvent(const rc_client_event_t* event)
12031203

12041204
if (EmuConfig.Achievements.SoundEffects && EmuConfig.Achievements.UnlockSound)
12051205
Common::PlaySoundAsync(
1206-
(EmuConfig.Achievements.UnlockSoundName.empty()
1206+
(EmuConfig.Achievements.UnlockSoundName.empty() || !FileSystem::FileExists(EmuConfig.Achievements.UnlockSoundName.c_str())
12071207
? Path::Combine(EmuFolders::Resources, DEFAULT_UNLOCK_SOUND_NAME)
12081208
: EmuConfig.Achievements.UnlockSoundName).c_str()
12091209
);
@@ -1328,7 +1328,7 @@ void Achievements::HandleLeaderboardSubmittedEvent(const rc_client_event_t* even
13281328

13291329
if (EmuConfig.Achievements.SoundEffects && EmuConfig.Achievements.LBSubmitSound)
13301330
Common::PlaySoundAsync(
1331-
(EmuConfig.Achievements.LBSubmitSoundName.empty()
1331+
(EmuConfig.Achievements.LBSubmitSoundName.empty() || !FileSystem::FileExists(EmuConfig.Achievements.LBSubmitSoundName.c_str())
13321332
? Path::Combine(EmuFolders::Resources, DEFAULT_LBSUBMIT_SOUND_NAME)
13331333
: EmuConfig.Achievements.LBSubmitSoundName).c_str()
13341334
);

0 commit comments

Comments
 (0)