Skip to content

Commit 1020421

Browse files
committed
Added support for sync-once values
1 parent 778e831 commit 1020421

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

MLAPI/Data/NetworkedCollections/NetworkedDictionary.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ public bool CanClientRead(uint clientId)
259259
public bool IsDirty()
260260
{
261261
if (dirtyEvents.Count == 0) return false;
262-
if (Settings.SendTickrate <= 0) return true;
262+
if (Settings.SendTickrate == 0) return true;
263+
if (Settings.SendTickrate < 0) return false;
263264
if (NetworkingManager.singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
264265
return false;
265266
}

MLAPI/Data/NetworkedCollections/NetworkedList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public void ResetDirty()
7171
public bool IsDirty()
7272
{
7373
if (dirtyEvents.Count == 0) return false;
74-
if (Settings.SendTickrate <= 0) return true;
74+
if (Settings.SendTickrate == 0) return true;
75+
if (Settings.SendTickrate < 0) return false;
7576
if (NetworkingManager.singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
7677
return false;
7778
}

MLAPI/Data/NetworkedVar.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public void ResetDirty()
108108
public bool IsDirty()
109109
{
110110
if (!isDirty) return false;
111-
if (Settings.SendTickrate <= 0) return true;
111+
if (Settings.SendTickrate == 0) return true;
112+
if (Settings.SendTickrate < 0) return false;
112113
if (NetworkingManager.singleton.NetworkTime - LastSyncedTime >= (1f / Settings.SendTickrate)) return true;
113114
return false;
114115
}

0 commit comments

Comments
 (0)