mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: Remove RoomPlayer from roomSlots on Disconnect
This commit is contained in:
parent
055a264660
commit
2a2f76c263
@ -247,10 +247,17 @@ public override void OnServerDisconnect(NetworkConnection conn)
|
||||
{
|
||||
if (conn.identity != null)
|
||||
{
|
||||
NetworkRoomPlayer player = conn.identity.GetComponent<NetworkRoomPlayer>();
|
||||
NetworkRoomPlayer roomPlayer = conn.identity.GetComponent<NetworkRoomPlayer>();
|
||||
|
||||
if (player != null)
|
||||
roomSlots.Remove(player);
|
||||
if (roomPlayer != null)
|
||||
roomSlots.Remove(roomPlayer);
|
||||
|
||||
foreach (NetworkIdentity clientOwnedObject in conn.clientOwnedObjects)
|
||||
{
|
||||
roomPlayer = clientOwnedObject.GetComponent<NetworkRoomPlayer>();
|
||||
if (roomPlayer != null)
|
||||
roomSlots.Remove(roomPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
allPlayersReady = false;
|
||||
|
Loading…
Reference in New Issue
Block a user