From 0824ea39843003d2ef1af1e4b7fdf11e35347fd7 Mon Sep 17 00:00:00 2001 From: Vittorio Alfieri Date: Sat, 23 Oct 2021 21:44:28 +0200 Subject: [PATCH] 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). --- CHANGELOG.md | 4 +++- projects/mtg/src/GameStateDuel.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0442c116..c0de0b560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## [master] (https://github.com/WagicProject/wagic/tree/master) ### 23/10/21 -- *Committed:* Renamed some decks for AI. ([Vitty85](https://github.com/Vitty85)) +- *Committed:* 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). ([Vitty85](https://github.com/Vitty85)) + +- *Committed:* Renamed some decks for AI. https://github.com/WagicProject/wagic/commit/63c5ff2789776a4faa70245b0f97f9b3828501b0 ([Vitty85](https://github.com/Vitty85)) ### 21/10/21 - *Committed:* Renamed a deck for AI, fixed test suite (one test seems to randomly fail on AI choice without a real bug). https://github.com/WagicProject/wagic/commit/31530215a527d37e219fbe2c9d47dab5cc584e59 ([Vitty85](https://github.com/Vitty85)) diff --git a/projects/mtg/src/GameStateDuel.cpp b/projects/mtg/src/GameStateDuel.cpp index 92acdf4e3..9c6e1be7e 100644 --- a/projects/mtg/src/GameStateDuel.cpp +++ b/projects/mtg/src/GameStateDuel.cpp @@ -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;