Compare commits

...

2 Commits

Author SHA1 Message Date
JesusLuvsYooh
a32631598e
Merge 9efd8a9473 into 499e4daea3 2024-11-08 18:59:14 +08:00
JesusLuvsYooh
9efd8a9473 Check if counter is more than. Allows for runtime changing of SIM. 2024-08-08 23:22:39 +01:00

View File

@ -61,7 +61,7 @@ void LateUpdate()
// instead. // instead.
if (isServer || (IsClientWithAuthority && NetworkClient.ready)) if (isServer || (IsClientWithAuthority && NetworkClient.ready))
{ {
if (sendIntervalCounter == sendIntervalMultiplier && (!onlySyncOnChange || Changed(Construct()))) if (sendIntervalCounter >= sendIntervalMultiplier && (!onlySyncOnChange || Changed(Construct())))
SetDirty(); SetDirty();
CheckLastSendTime(); CheckLastSendTime();
@ -129,7 +129,7 @@ protected virtual void CheckLastSendTime()
// timeAsDouble not available in older Unity versions. // timeAsDouble not available in older Unity versions.
if (AccurateInterval.Elapsed(NetworkTime.localTime, NetworkServer.sendInterval, ref lastSendIntervalTime)) if (AccurateInterval.Elapsed(NetworkTime.localTime, NetworkServer.sendInterval, ref lastSendIntervalTime))
{ {
if (sendIntervalCounter == sendIntervalMultiplier) if (sendIntervalCounter >= sendIntervalMultiplier)
sendIntervalCounter = 0; sendIntervalCounter = 0;
sendIntervalCounter++; sendIntervalCounter++;
} }