Skip to content

Commit

Permalink
[MP] Fix division by zero in network profiler
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Faless committed Sep 2, 2024
1 parent 61598c5 commit 042b264
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/multiplayer/editor/editor_network_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
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;
}
if (info.outgoing_syncs) {
if (p_frame.outgoing_syncs) {
info.outgoing_size = p_frame.outgoing_size / p_frame.outgoing_syncs;
}
}
Expand Down

0 comments on commit 042b264

Please sign in to comment.