From de59e32ce39eacb3baf62593586841be1bc07bd4 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 30 Dec 2018 22:52:38 +0100 Subject: [PATCH] NetworkServer.SpawnObjects: use foreach in second loop too --- Mirror/Runtime/NetworkServer.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Mirror/Runtime/NetworkServer.cs b/Mirror/Runtime/NetworkServer.cs index 00b7662a7..8cf10d994 100644 --- a/Mirror/Runtime/NetworkServer.cs +++ b/Mirror/Runtime/NetworkServer.cs @@ -1199,16 +1199,15 @@ public static bool SpawnObjects() } } - for (int i = 0; i < identities.Length; i++) + foreach (NetworkIdentity identity in identities) { - NetworkIdentity identity = identities[i]; - if (!ValidateSceneObject(identity)) - continue; + if (ValidateSceneObject(identity)) + { + Spawn(identity.gameObject); - Spawn(identity.gameObject); - - // these objects are server authority - even if "localPlayerAuthority" is set on them - identity.ForceAuthority(true); + // these objects are server authority - even if "localPlayerAuthority" is set on them + identity.ForceAuthority(true); + } } return true; }