diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index fa02926287..5814739ba6 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -8,9 +8,14 @@ Additional documentation and release notes are available at [Multiplayer Documen ## [Unreleased] +### Added + ### Fixed - Fixed a bug where having a class with Rpcs that inherits from a class without Rpcs that inherits from NetworkVariable would cause a compile error. (#2751) +- Fixed issue where `NetworkBehaviour.Synchronize` was not truncating the write buffer if nothing was serialized during `NetworkBehaviour.OnSynchronize` causing an additional 6 bytes to be written per `NetworkBehaviour` component instance. (#2749) + +### Changed ## [1.7.0] - 2023-10-11 diff --git a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs index e0d0f21bef..7a5bd73b32 100644 --- a/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs +++ b/com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs @@ -993,6 +993,8 @@ internal bool Synchronize(ref BufferSerializer serializer, ulong targetCli if (finalPosition == positionBeforeSynchronize || threwException) { writer.Seek(positionBeforeWrite); + // Truncate back to the size before + writer.Truncate(); return false; } else