From dff37687c052e9a304859d21a03cf3e403991c37 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Sun, 13 Mar 2022 03:28:58 +0100 Subject: [PATCH] Fix /play not setting the currentmusic correctly --- core/src/commands/music.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/commands/music.cpp b/core/src/commands/music.cpp index 0fdc1f3..629bb63 100644 --- a/core/src/commands/music.cpp +++ b/core/src/commands/music.cpp @@ -29,8 +29,12 @@ void AOClient::cmdPlay(int argc, QStringList argv) } AreaData* l_area = server->m_areas[m_current_area]; QString l_song = argv.join(" "); - l_area->currentMusic() = l_song; - l_area->musicPlayerBy() = m_showname; + if (m_showname.isEmpty()) { + l_area->changeMusic(m_current_char, l_song); + } + else { + l_area->changeMusic(m_showname, l_song); + } AOPacket music_change("MC", {l_song, QString::number(server->getCharID(m_current_char)), m_showname, "1", "0"}); server->broadcast(music_change, m_current_area); }