From 95113a7cd58b164133ed5ce1e372ce764954f375 Mon Sep 17 00:00:00 2001 From: Wei Guo Date: Sun, 23 Oct 2022 14:01:51 +0800 Subject: [PATCH] Fix MultiplayerSynchronizer::update_outbound_sync_time when replication_interval is not 0 --- modules/multiplayer/multiplayer_synchronizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/multiplayer/multiplayer_synchronizer.cpp b/modules/multiplayer/multiplayer_synchronizer.cpp index 9755f426d50..95857392c7f 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;