Skip to content

Commit 9546ff2

Browse files
fix
Fixing issue with temporary buffer not being copied over properly when synchronizing.
1 parent e83eb23 commit 9546ff2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

com.unity.netcode.gameobjects/Runtime/SceneManagement/SceneEventData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ internal void SynchronizeSceneNetworkObjects(NetworkManager networkManager)
11571157
{
11581158
RegistrationTime = UnityEngine.Time.realtimeSinceStartup,
11591159
SerializedObject = serializedObject,
1160-
Buffer = new FastBufferReader(InternalBuffer, Allocator.Persistent, serializedObject.SynchronizationDataSize)
1160+
Buffer = new FastBufferReader(InternalBuffer, Allocator.Persistent, serializedObject.SynchronizationDataSize, InternalBuffer.Position)
11611161
};
11621162

11631163
spawnManager.RegisterGhostPendingSynchronization(newEntry);
@@ -1174,9 +1174,9 @@ internal void SynchronizeSceneNetworkObjects(NetworkManager networkManager)
11741174
}
11751175
var spawnedNetworkObject = NetworkObject.Deserialize(serializedObject, InternalBuffer, networkManager);
11761176

1177-
var noStop = InternalBuffer.Position;
11781177
if (EnableSerializationLogs)
11791178
{
1179+
var noStop = InternalBuffer.Position;
11801180
builder.AppendLine($"[Head: {noStart}][Tail: {noStop}][Size: {noStop - noStart}][{spawnedNetworkObject.name}][NID-{spawnedNetworkObject.NetworkObjectId}][Children: {spawnedNetworkObject.ChildNetworkBehaviours.Count}]");
11811181
LogArray(InternalBuffer.ToArray(), noStart, noStop, builder);
11821182
}

0 commit comments

Comments
 (0)