diff --git a/src/citra_qt/multiplayer/host_room.cpp b/src/citra_qt/multiplayer/host_room.cpp index 3f53b3c8ac..9469153789 100644 --- a/src/citra_qt/multiplayer/host_room.cpp +++ b/src/citra_qt/multiplayer/host_room.cpp @@ -75,13 +75,10 @@ void HostRoomWindow::Host() { } if (auto member = Network::GetRoomMember().lock()) { if (member->IsConnected()) { - if (!NetworkMessage::WarnDisconnect()) { + auto parent = static_cast(parentWidget()); + if (!parent->OnCloseRoom()) { close(); return; - } else { - member->Leave(); - auto parent = static_cast(parentWidget()); - parent->OnCloseRoom(); } } ui->host->setDisabled(true); diff --git a/src/citra_qt/multiplayer/state.cpp b/src/citra_qt/multiplayer/state.cpp index 5339868fbc..3c40a7d866 100644 --- a/src/citra_qt/multiplayer/state.cpp +++ b/src/citra_qt/multiplayer/state.cpp @@ -112,9 +112,9 @@ void MultiplayerState::OnCreateRoom() { BringWidgetToFront(host_room); } -void MultiplayerState::OnCloseRoom() { +bool MultiplayerState::OnCloseRoom() { if (!NetworkMessage::WarnCloseRoom()) - return; + return false; if (auto room = Network::GetRoom().lock()) { // if you are in a room, leave it if (auto member = Network::GetRoomMember().lock()) { @@ -123,11 +123,12 @@ void MultiplayerState::OnCloseRoom() { // if you are hosting a room, also stop hosting if (room->GetState() != Network::Room::State::Open) { - return; + return true; } room->Destroy(); announce_multiplayer_session->Stop(); } + return true; } void MultiplayerState::OnOpenNetworkRoom() { diff --git a/src/citra_qt/multiplayer/state.h b/src/citra_qt/multiplayer/state.h index 1829d19fb2..673bc6ecf6 100644 --- a/src/citra_qt/multiplayer/state.h +++ b/src/citra_qt/multiplayer/state.h @@ -42,7 +42,7 @@ public slots: void OnNetworkStateChanged(const Network::RoomMember::State& state); void OnViewLobby(); void OnCreateRoom(); - void OnCloseRoom(); + bool OnCloseRoom(); void OnOpenNetworkRoom(); void OnDirectConnectToRoom(); void OnAnnounceFailed(const Common::WebResult&);