Skip to content

Commit 64286b2

Browse files
Initialise _syncEnabled in OnNetworkSpawn
1 parent 2f923d4 commit 64286b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CSync/Lib/ConfigSyncBehaviour.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public bool SyncEnabled
2828
set => _syncEnabled.Value = value;
2929
}
3030

31-
private readonly NetworkVariable<bool> _syncEnabled = new() { Value = true };
31+
private readonly NetworkVariable<bool> _syncEnabled = new();
3232
private NetworkList<SyncedEntryDelta> _deltas = null!;
3333

3434
[MemberNotNull(nameof(EntryContainer))]
@@ -50,6 +50,8 @@ public override void OnNetworkSpawn()
5050

5151
if (IsServer)
5252
{
53+
_syncEnabled.Value = true;
54+
5355
foreach (var syncedEntryBase in EntryContainer.Values)
5456
{
5557
var currentIndex = _deltas.Count;

0 commit comments

Comments
 (0)