fix crash when a client reconnects to the same client slot, thanks to div0 for report...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Dec 2006 13:30:16 +0000 (13:30 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Dec 2006 13:30:16 +0000 (13:30 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6643 d7cf8633-e32d-0410-b094-e92efae38249

netconn.c

index d876b92..8f31e4e 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -1893,7 +1893,9 @@ static int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, unsigned char *dat
                                                if (developer.integer >= 10)
                                                        Con_Printf("Datagram_ParseConnectionless: sending \"accept\" to %s.\n", addressstring2);
                                                NetConn_WriteString(mysocket, "\377\377\377\377accept", peeraddress);
+                                               SV_VM_Begin();
                                                SV_SendServerinfo(client);
+                                               SV_VM_End();
                                        }
                                        else
                                        {
@@ -2078,7 +2080,11 @@ static int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, unsigned char *dat
                                        // if client is already spawned, re-send the
                                        // serverinfo message as they'll need it to play
                                        if (client->spawned)
+                                       {
+                                               SV_VM_Begin();
                                                SV_SendServerinfo(client);
+                                               SV_VM_End();
+                                       }
                                        return true;
                                }
                        }