mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
[Net] Fix ENet 'connect_to_host' creating only one channel.
Passing `0` to `enet_host_create` will allow the maximum amount of channel supported by ENet. For some reasons, `connect_to_host` will instead only create 1 channel when passed `0`. This commit normalize the behaviour to always allocate the maximum allowed channels when passing `0`.
This commit is contained in:
parent
e95e33f251
commit
b4fc69e0e2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user