Merge pull request #96464 from Faless/mp/fix_profiler_divsion_by_zero
Some checks are pending
🔗 GHA / 📊 Static checks (push) Waiting to run
🔗 GHA / 🤖 Android (push) Blocked by required conditions
🔗 GHA / 🍏 iOS (push) Blocked by required conditions
🔗 GHA / 🐧 Linux (push) Blocked by required conditions
🔗 GHA / 🍎 macOS (push) Blocked by required conditions
🔗 GHA / 🏁 Windows (push) Blocked by required conditions
🔗 GHA / 🌐 Web (push) Blocked by required conditions
🔗 GHA / 🪲 Godot CPP (push) Blocked by required conditions

[MP] Fix division by zero in network profiler
This commit is contained in:
Rémi Verschelde 2024-09-02 18:08:17 +02:00
commit 7c383767a2
No known key found for this signature in database
GPG Key ID: C3336907360768E1

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;
} }
} }