Skip to content

Commit

Permalink
Merge pull request #808 from gregharding/synctimer-fix
Browse files Browse the repository at this point in the history
Fix SyncTimer update time on clients
  • Loading branch information
FirstGearGames authored Nov 8, 2024
2 parents 5fc902b + de9d8f5 commit 22b9588
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Assets/FishNet/Runtime/Object/Synchronizing/Beta/SyncTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ protected internal override void Read(PooledReader reader, bool asServer)
Paused = false;
Remaining = next;
Duration = duration;

SetUpdateTime();
}

if (newChangeId)
Expand Down Expand Up @@ -354,6 +356,12 @@ void UpdatePauseState(SyncTimerOperation op)
}

Paused = newPauseState;

if (!Paused && Remaining > 0f)
{
SetUpdateTime();
}

if (newChangeId)
InvokeOnChange(op, prev, next, asServer);
}
Expand Down

0 comments on commit 22b9588

Please sign in to comment.