瀏覽代碼

input_common: udp: Avoid crash when trying to map motion before client is ready

german77 2 年之前
父節點
當前提交
eae0570a1c
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/input_common/drivers/udp_client.cpp

+ 1 - 0
src/input_common/drivers/udp_client.cpp

@@ -338,6 +338,7 @@ void UDPClient::StartCommunication(std::size_t client, const std::string& host,
     for (std::size_t index = 0; index < PADS_PER_CLIENT; ++index) {
     for (std::size_t index = 0; index < PADS_PER_CLIENT; ++index) {
         const PadIdentifier identifier = GetPadIdentifier(client * PADS_PER_CLIENT + index);
         const PadIdentifier identifier = GetPadIdentifier(client * PADS_PER_CLIENT + index);
         PreSetController(identifier);
         PreSetController(identifier);
+        PreSetMotion(identifier, 0);
     }
     }
 }
 }