Remove duplicated logic in HostRoom
Fixes some issues with multiple warning messages
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user