Skip to content

Commit

Permalink
fix: Fix Room Slots for clients (#1439)
Browse files Browse the repository at this point in the history
* Fix Room Slots for clients

* Removed change to ServerChangeScene
  • Loading branch information
MrGadget authored and miwarnec committed Jan 19, 2020
1 parent cb4be4d commit 268753c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Assets/Mirror/Components/NetworkRoomManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,9 @@ public override void OnServerAddPlayer(NetworkConnection conn)

NetworkRoomPlayer newRoomPlayer = newRoomGameObject.GetComponent<NetworkRoomPlayer>();

roomSlots.Add(newRoomPlayer);
NetworkServer.AddPlayerForConnection(conn, newRoomGameObject);

RecalculateRoomPlayerIndices();

NetworkServer.AddPlayerForConnection(conn, newRoomGameObject);
}

void RecalculateRoomPlayerIndices()
Expand Down
2 changes: 2 additions & 0 deletions Assets/Mirror/Components/NetworkRoomPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public void Start()
if (room.dontDestroyOnLoad)
DontDestroyOnLoad(gameObject);

room.roomSlots.Add(this);

OnClientEnterRoom();
}
else
Expand Down

0 comments on commit 268753c

Please sign in to comment.