NetworkManager.OnValidate: no need to artificially limit max connections

This commit is contained in:
vis2k 2019-01-06 15:47:37 +01:00
parent 430e6bc6a7
commit 8b151e71cf

View File

@ -145,7 +145,7 @@ public virtual void OnApplicationQuit()
// virtual so that inheriting classes' OnValidate() can call base.OnValidate() too // virtual so that inheriting classes' OnValidate() can call base.OnValidate() too
public virtual void OnValidate() public virtual void OnValidate()
{ {
maxConnections = Mathf.Clamp(maxConnections, 1, 32000); // [1, 32000] maxConnections = Mathf.Max(maxConnections, 0); // always >= 0
if (playerPrefab != null && playerPrefab.GetComponent<NetworkIdentity>() == null) if (playerPrefab != null && playerPrefab.GetComponent<NetworkIdentity>() == null)
{ {