Changed spawnedObjects counting code
This commit is contained in:
parent
9b76a81f1f
commit
95082334af
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MLAPI
|
namespace MLAPI
|
||||||
{
|
{
|
||||||
@ -1136,14 +1137,9 @@ namespace MLAPI
|
|||||||
|
|
||||||
|
|
||||||
int sizeOfStream = 16 + ((connectedClients.Count - 1) * 4);
|
int sizeOfStream = 16 + ((connectedClients.Count - 1) * 4);
|
||||||
int amountOfObjectsToSend = 0;
|
|
||||||
foreach (KeyValuePair<uint, NetworkedObject> pair in SpawnManager.spawnedObjects)
|
int amountOfObjectsToSend = SpawnManager.spawnedObjects.Values.Count(x => x.ServerOnly == false);
|
||||||
{
|
|
||||||
if (pair.Value.ServerOnly)
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
amountOfObjectsToSend++;
|
|
||||||
}
|
|
||||||
if(NetworkConfig.HandleObjectSpawning)
|
if(NetworkConfig.HandleObjectSpawning)
|
||||||
{
|
{
|
||||||
sizeOfStream += 4;
|
sizeOfStream += 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user