NetworkServer.SpawnObjects: use foreach in second loop too

This commit is contained in:
vis2k 2018-12-30 22:52:38 +01:00
parent 1418fb66b7
commit de59e32ce3

View File

@ -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))
if (!ValidateSceneObject(identity)) {
continue; 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; return true;
} }