From f1e65959a0b9f8f8a533544440256c301ac4d487 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Mon, 13 Sep 2021 23:42:15 +0200 Subject: [PATCH 1/2] Fix Jukebox incorrectly discarding songs --- core/src/area_data.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/area_data.cpp b/core/src/area_data.cpp index 4f2e763..05c9162 100644 --- a/core/src/area_data.cpp +++ b/core/src/area_data.cpp @@ -536,22 +536,22 @@ void AreaData::toggleJukebox() QString AreaData::addJukeboxSong(QString f_song) { if(!m_jukebox_queue.contains(f_song)) { - if (m_jukebox_queue.size() == 0) { int l_song_duration = ConfigManager::songInformation(f_song); - if (l_song_duration >= 0) { - emit playJukeboxSong(AOPacket("MC",{f_song,QString::number(-1)}), index()); - m_jukebox_timer->start(l_song_duration * 1000); + if (l_song_duration > 0) { + if (m_jukebox_queue.size() == 0) { + emit playJukeboxSong(AOPacket("MC",{f_song,QString::number(-1)}), index()); + m_jukebox_timer->start(l_song_duration * 1000); + } setCurrentMusic(f_song); setMusicPlayedBy("Jukebox"); m_jukebox_queue.append(f_song); return "Song added to Jukebox."; } - } - return "Unable to add song. Duration shorther than 1."; - } - else { - return "Unable to add song. Song already in Jukebox."; + else { + return "Unable to add song. Duration shorther than 1."; + } } + return "Unable to add song. Song already in Jukebox."; } void AreaData::switchJukeboxSong() From 56c84cf235a8889eec23d03f11b671dd84981457 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Tue, 14 Sep 2021 00:03:05 +0200 Subject: [PATCH 2/2] Literally unreadable Co-authored-by: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com> --- core/src/area_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/area_data.cpp b/core/src/area_data.cpp index 05c9162..86566eb 100644 --- a/core/src/area_data.cpp +++ b/core/src/area_data.cpp @@ -548,7 +548,7 @@ QString AreaData::addJukeboxSong(QString f_song) return "Song added to Jukebox."; } else { - return "Unable to add song. Duration shorther than 1."; + return "Unable to add song. Duration shorter than 1."; } } return "Unable to add song. Song already in Jukebox.";