shithub: choc

Download patch

ref: 26a2ba193ee3d93421f9fd50f25534031cd0f456
parent: ff67ee37fb68659245683b7d3a0f091a299d66f2
author: Simon Howard <[email protected]>
date: Sat Jun 3 14:23:09 EDT 2006

Stop sending data to the server when a connection drops. Print a message
to the console as well.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 557

--- a/src/net_client.c
+++ b/src/net_client.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: net_client.c 475 2006-05-05 19:49:34Z fraggle $
+// $Id: net_client.c 557 2006-06-03 18:23:09Z fraggle $
 //
 // Copyright(C) 2005 Simon Howard
 //
@@ -308,6 +308,7 @@
     // disconnected from server
 
     players[consoleplayer].message = "Disconnected from server";
+    printf("Disconnected from server.\n");
 
     for (i=0; i<MAXPLAYERS; ++i)
     {
@@ -507,6 +508,14 @@
 {
     net_packet_t *packet;
     int i;
+
+    if (!net_client_connected)
+    {
+        // Disconnected from server
+
+        return;
+    }
+
 
     if (start < 0)
         start = 0;