[MP] Fix division by zero in network profiler

The debugger reports synchronizers with empty state to the editor
even if no data is being sent to other peers.

The editor conditional to avoid division by zero was checking the wrong
variable.

(cherry picked from commit 042b264c55)
This commit is contained in:
Fabio Alessandrelli 2024-09-02 10:55:43 +02:00 committed by Rémi Verschelde
parent e72e42fe9b
commit 1a5ac1fd59
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 2 deletions

View File

@ -227,10 +227,10 @@ void EditorNetworkProfiler::add_sync_frame_data(const SyncInfo &p_frame) {
sync_data[p_frame.synchronizer].outgoing_syncs += p_frame.outgoing_syncs; sync_data[p_frame.synchronizer].outgoing_syncs += p_frame.outgoing_syncs;
} }
SyncInfo &info = sync_data[p_frame.synchronizer]; SyncInfo &info = sync_data[p_frame.synchronizer];
if (info.incoming_syncs) { if (p_frame.incoming_syncs) {
info.incoming_size = p_frame.incoming_size / p_frame.incoming_syncs; info.incoming_size = p_frame.incoming_size / p_frame.incoming_syncs;
} }
if (info.outgoing_syncs) { if (p_frame.outgoing_syncs) {
info.outgoing_size = p_frame.outgoing_size / p_frame.outgoing_syncs; info.outgoing_size = p_frame.outgoing_size / p_frame.outgoing_syncs;
} }
} }