Skip to content

Commit 042b264

Browse files
committed
[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.
1 parent 61598c5 commit 042b264

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/multiplayer/editor/editor_network_profiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ void EditorNetworkProfiler::add_sync_frame_data(const SyncInfo &p_frame) {
227227
sync_data[p_frame.synchronizer].outgoing_syncs += p_frame.outgoing_syncs;
228228
}
229229
SyncInfo &info = sync_data[p_frame.synchronizer];
230-
if (info.incoming_syncs) {
230+
if (p_frame.incoming_syncs) {
231231
info.incoming_size = p_frame.incoming_size / p_frame.incoming_syncs;
232232
}
233-
if (info.outgoing_syncs) {
233+
if (p_frame.outgoing_syncs) {
234234
info.outgoing_size = p_frame.outgoing_size / p_frame.outgoing_syncs;
235235
}
236236
}

0 commit comments

Comments
 (0)