Răsfoiți Sursa

Merge pull request #5236 from gal20/udp_client_patch

input_common: process udp packets only for the correct pad
bunnei 5 ani în urmă
părinte
comite
22ba437aa4
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 5 0
      src/input_common/udp/client.cpp

+ 5 - 0
src/input_common/udp/client.cpp

@@ -225,6 +225,11 @@ void Client::OnPortInfo([[maybe_unused]] Response::PortInfo data) {
 }
 
 void Client::OnPadData(Response::PadData data, std::size_t client) {
+    // Accept packets only for the correct pad
+    if (static_cast<u8>(clients[client].pad_index) != data.info.id) {
+        return;
+    }
+
     LOG_TRACE(Input, "PadData packet received");
     if (data.packet_counter == clients[client].packet_sequence) {
         LOG_WARNING(