From 9efd8a947394350c6b2190a4580c32c2946f3415 Mon Sep 17 00:00:00 2001 From: JesusLuvsYooh Date: Thu, 8 Aug 2024 23:22:39 +0100 Subject: [PATCH] Check if counter is more than. Allows for runtime changing of SIM. --- .../Components/NetworkTransform/NetworkTransformReliable.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Mirror/Components/NetworkTransform/NetworkTransformReliable.cs b/Assets/Mirror/Components/NetworkTransform/NetworkTransformReliable.cs index b81433773..fb1ca211c 100644 --- a/Assets/Mirror/Components/NetworkTransform/NetworkTransformReliable.cs +++ b/Assets/Mirror/Components/NetworkTransform/NetworkTransformReliable.cs @@ -61,7 +61,7 @@ void LateUpdate() // instead. if (isServer || (IsClientWithAuthority && NetworkClient.ready)) { - if (sendIntervalCounter == sendIntervalMultiplier && (!onlySyncOnChange || Changed(Construct()))) + if (sendIntervalCounter >= sendIntervalMultiplier && (!onlySyncOnChange || Changed(Construct()))) SetDirty(); CheckLastSendTime(); @@ -129,7 +129,7 @@ protected virtual void CheckLastSendTime() // timeAsDouble not available in older Unity versions. if (AccurateInterval.Elapsed(NetworkTime.localTime, NetworkServer.sendInterval, ref lastSendIntervalTime)) { - if (sendIntervalCounter == sendIntervalMultiplier) + if (sendIntervalCounter >= sendIntervalMultiplier) sendIntervalCounter = 0; sendIntervalCounter++; }