From 872965cbc312f6e7a7f4cfaeb24e5c9234c83405 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 2 Sep 2024 10:55:43 +0200 Subject: [PATCH] [MP] Fix division by zero in network profile The check to avoid divsion by zero was checking the wrong variable. --- modules/multiplayer/editor/editor_network_profiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp index d5d4b465d8c2..212fd1ef6bc8 100644 --- a/modules/multiplayer/editor/editor_network_profiler.cpp +++ b/modules/multiplayer/editor/editor_network_profiler.cpp @@ -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; } }