Browse Source

Set ENet service time to 0.

Process all packets in queue, but never wait.
Fabio Alessandrelli 7 years ago
parent
commit
977c9477c1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      modules/enet/networked_multiplayer_enet.cpp

+ 2 - 2
modules/enet/networked_multiplayer_enet.cpp

@@ -207,13 +207,13 @@ void NetworkedMultiplayerENet::poll() {
 	_pop_current_packet();
 
 	ENetEvent event;
-	/* Wait up to 1000 milliseconds for an event. */
+	/* Keep servicing until there are no available events left in queue. */
 	while (true) {
 
 		if (!host || !active) // Might have been disconnected while emitting a notification
 			return;
 
-		int ret = enet_host_service(host, &event, 1);
+		int ret = enet_host_service(host, &event, 0);
 
 		if (ret < 0) {
 			// Error, do something?