Skip to content

Commit 677239c

Browse files
committed
Added isHost check to prevent trying to reconnect on host
1 parent d54a38e commit 677239c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Assets/BossRoom/Scripts/Shared/Net/ConnectionManagement/ClientGameNetPortal.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private void OnDisconnectOrTimeout(ulong clientID)
141141
//We have to check here in SceneManager if our active scene is the main menu, as if it is, it means we timed out rather than a raw disconnect;
142142
if (SceneManager.GetActiveScene().name != "MainMenu")
143143
{
144-
if (DisconnectReason.Reason == ConnectStatus.UserRequestedDisconnect)
144+
if (DisconnectReason.Reason == ConnectStatus.UserRequestedDisconnect || NetworkManager.Singleton.IsHost)
145145
{
146146
// simply shut down and go back to main menu
147147
NetworkManager.Singleton.Shutdown();

0 commit comments

Comments
 (0)