diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-30 15:45:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 15:45:59 +0200 |
commit | a7363f3dfd32ecff77d4d6937be9f232bfc699c7 (patch) | |
tree | 24c24e67a90e231c407962747778c27f5390e2a9 /modules | |
parent | 92c5c46da7e5990ac328437ffea6ec3fcd8a0f10 (diff) | |
parent | b4fc69e0e276b2b8cb224aa857e4fc838ff9237b (diff) |
Merge pull request #51066 from Faless/enet/4.x_channels_fix
[Net] Fix ENet 'connect_to_host' creating only one channel.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/enet/enet_connection.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/enet/enet_connection.cpp b/modules/enet/enet_connection.cpp index 0bda9402f8..e833264d6a 100644 --- a/modules/enet/enet_connection.cpp +++ b/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; |