Browse Source

Merge pull request #67780 from kdada/fix-multiplayer-sync-time

Fix MultiplayerSynchronizer::update_outbound_sync_time when replication_interval is not 0
Fabio Alessandrelli 2 years ago
parent
commit
0d04e7ec91
1 changed files with 4 additions and 0 deletions
  1. 4 0
      modules/multiplayer/multiplayer_synchronizer.cpp

+ 4 - 0
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) {
 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) {
 	if (p_msec >= last_sync_msec + interval_msec) {
 		last_sync_msec = p_msec;
 		last_sync_msec = p_msec;
 		return true;
 		return true;