Fixed a Bug in MusicExist method of GameStateDuel class when filename parameter was empty (this could lead to a wrong check on which soundtrack has to be played).

This commit is contained in:
Vittorio Alfieri
2021-10-23 21:44:28 +02:00
parent 63c5ff2789
commit 0824ea3984
2 changed files with 5 additions and 1 deletions

View File

@@ -375,6 +375,8 @@ void GameStateDuel::End()
//TODO Move This to utils or ResourceManager. Don't we have more generic functions that can do that?
bool GameStateDuel::MusicExist(string FileName)
{
if (FileName.length() < 1) return false; // Fixed a problem when Music filename is empty.
string musicFilename = WResourceManager::Instance()->musicFile(FileName);
if (musicFilename.length() < 1) return false;