summaryrefslogtreecommitdiff
path: root/modules/multiplayer
diff options
context:
space:
mode:
authorWei Guo <me@imkira.com>2022-10-23 14:01:51 +0800
committerWei Guo <me@imkira.com>2022-10-23 14:01:51 +0800
commit95113a7cd58b164133ed5ce1e372ce764954f375 (patch)
tree241350aba41a10d3f90e671d2bfa5b2fdd6786f0 /modules/multiplayer
parent4546986d21e862cd11d9d541f6e8347483fd7f69 (diff)
Fix MultiplayerSynchronizer::update_outbound_sync_time when replication_interval is not 0
Diffstat (limited to 'modules/multiplayer')
-rw-r--r--modules/multiplayer/multiplayer_synchronizer.cpp4
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;