소스 검색

Merge pull request #51066 from Faless/enet/4.x_channels_fix

[Net] Fix ENet 'connect_to_host' creating only one channel.
Rémi Verschelde 4 년 전
부모
커밋
a7363f3dfd
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      modules/enet/enet_connection.cpp

+ 1 - 1
modules/enet/enet_connection.cpp

@@ -107,7 +107,7 @@ Ref<ENetPacketPeer> ENetConnection::connect_to_host(const String &p_address, int
 	address.port = p_port;
 
 	// Initiate connection, allocating enough channels
-	ENetPeer *peer = enet_host_connect(host, &address, p_channels, p_data);
+	ENetPeer *peer = enet_host_connect(host, &address, p_channels > 0 ? p_channels : ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT, p_data);
 
 	if (peer == nullptr) {
 		return nullptr;