summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-09-02 15:21:09 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-09-02 15:21:09 +0200
commit027fbc9a6cce94fad12d056e44e0acecf6650da7 (patch)
tree080a74a5b994929ec39358cdc2dfecaf8a243dc6
parentc97afc033f720a68b3ea8dabb2956d836d13613e (diff)
[Net] Silence ENetMultiplayerPeer close_connection.
Used to print an error when it was not active, now it just returns immediately as per the documentation.
-rw-r--r--modules/enet/enet_multiplayer_peer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/enet/enet_multiplayer_peer.cpp b/modules/enet/enet_multiplayer_peer.cpp
index 38ca38385c..7a9a780238 100644
--- a/modules/enet/enet_multiplayer_peer.cpp
+++ b/modules/enet/enet_multiplayer_peer.cpp
@@ -393,7 +393,9 @@ bool ENetMultiplayerPeer::is_server() const {
}
void ENetMultiplayerPeer::close_connection(uint32_t wait_usec) {
- ERR_FAIL_COND_MSG(!_is_active(), "The multiplayer instance isn't currently active.");
+ if (!_is_active()) {
+ return;
+ }
_pop_current_packet();