Fixed potential issue when destroying objects

This commit is contained in:
Albin Corén 2018-04-02 17:38:57 +02:00
parent 4b8b88d550
commit 17a594ee98

View File

@ -76,6 +76,8 @@ namespace MLAPI.NetworkingManagerComponents.Core
}
internal static void DestroyNonSceneObjects()
{
if(spawnedObjects != null)
{
foreach (KeyValuePair<uint, NetworkedObject> netObject in spawnedObjects)
{
@ -83,6 +85,7 @@ namespace MLAPI.NetworkingManagerComponents.Core
MonoBehaviour.Destroy(netObject.Value.gameObject);
}
}
}
internal static GameObject SpawnObject(int spawnablePrefabIndex, uint networkId, int ownerId, Vector3 position, Quaternion rotation)
{