diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-10-23 09:25:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-23 09:25:16 +0200 |
commit | 0d04e7ec914ff609dfbdfff3dca04ed12a21e600 (patch) | |
tree | 0b03a217d0b65e7c3d53b71312e329960bec30b0 | |
parent | 38691d5b1d29a4fbd0d87f3a09120911e4cc1661 (diff) | |
parent | 95113a7cd58b164133ed5ce1e372ce764954f375 (diff) |
Merge pull request #67780 from kdada/fix-multiplayer-sync-time
Fix MultiplayerSynchronizer::update_outbound_sync_time when replication_interval is not 0
-rw-r--r-- | modules/multiplayer/multiplayer_synchronizer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/multiplayer/multiplayer_synchronizer.cpp b/modules/multiplayer/multiplayer_synchronizer.cpp index 9755f426d5..95857392c7 100644 --- a/modules/multiplayer/multiplayer_synchronizer.cpp +++ b/modules/multiplayer/multiplayer_synchronizer.cpp @@ -118,6 +118,10 @@ void MultiplayerSynchronizer::set_net_id(uint32_t p_net_id) { } bool MultiplayerSynchronizer::update_outbound_sync_time(uint64_t p_msec) { + if (last_sync_msec == p_msec) { + // last_sync_msec has been updated on this frame. + return true; + } if (p_msec >= last_sync_msec + interval_msec) { last_sync_msec = p_msec; return true; |