aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoreihrul <eihrul>2012-01-05 04:12:46 +0000
committereihrul <eihrul>2012-01-05 04:12:46 +0000
commit27d8c07142f9b469d1a62bf41435b074a7281e5f (patch)
treefa6b7d2aff0d0150b5fcab1be8ca90fe41cfc038
parent70d0d8f25d04813f2a094262def2206caf3932ea (diff)
downloadenet-27d8c07142f9b469d1a62bf41435b074a7281e5f.tar.gz
enet-27d8c07142f9b469d1a62bf41435b074a7281e5f.zip
only bail out of sending on a timeout if there really is an event to dispatch
-rw-r--r--protocol.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/protocol.c b/protocol.c
index 34658cd..2e111a8 100644
--- a/protocol.c
+++ b/protocol.c
@@ -1548,7 +1548,12 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch
! enet_list_empty (& currentPeer -> sentReliableCommands) &&
ENET_TIME_GREATER_EQUAL (host -> serviceTime, currentPeer -> nextTimeout) &&
enet_protocol_check_timeouts (host, currentPeer, event) == 1)
- return 1;
+ {
+ if (event != NULL && event -> type != ENET_EVENT_TYPE_NONE)
+ return 1;
+ else
+ continue;
+ }
if ((enet_list_empty (& currentPeer -> outgoingReliableCommands) ||
enet_protocol_send_reliable_outgoing_commands (host, currentPeer)) &&