瀏覽代碼

only bail out of sending on a timeout if there really is an event to dispatch

eihrul 13 年之前
父節點
當前提交
27d8c07142
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      protocol.c

+ 6 - 1
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)) &&