simplify NetworkIdentity.RebuildObservers

This commit is contained in:
vis2k 2019-03-21 17:58:13 +01:00
parent f0dd7549e6
commit 155764cea8

View File

@ -810,9 +810,8 @@ public void RebuildObservers(bool initialize)
// none of the behaviours rebuilt our observers, use built-in rebuild method // none of the behaviours rebuilt our observers, use built-in rebuild method
if (initialize) if (initialize)
{ {
foreach (KeyValuePair<int, NetworkConnection> kvp in NetworkServer.connections) foreach (NetworkConnection conn in NetworkServer.connections.Values)
{ {
NetworkConnection conn = kvp.Value;
if (conn.isReady) if (conn.isReady)
AddObserver(conn); AddObserver(conn);
} }