NetworkServer.SetClientReady: remove unnecessary null check because we don't have one in the above foreach either, and we don't have them anywhere else for NetworkIdentity.spawned because OnDestroy removes objects from it before they become null. The only way to cause this would be by calling Destroy(GetComponent<NetworkIdentity>()) - which no one does, and if someone does it then it's fine to get an exception here.

This commit is contained in:
vis2k 2019-03-22 12:08:47 +01:00
parent 9567daedba
commit 400bb91821

View File

@ -801,11 +801,6 @@ public static void SetClientReady(NetworkConnection conn)
foreach (NetworkIdentity identity in NetworkIdentity.spawned.Values) foreach (NetworkIdentity identity in NetworkIdentity.spawned.Values)
{ {
if (identity == null)
{
Debug.LogWarning("Invalid object found in server local object list (null NetworkIdentity).");
continue;
}
if (!identity.gameObject.activeSelf) if (!identity.gameObject.activeSelf)
{ {
continue; continue;