]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
preserve host_client during rcon (should fix crash for rcon restart)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 13 Jul 2008 16:37:14 +0000 (16:37 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 13 Jul 2008 16:37:14 +0000 (16:37 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8400 d7cf8633-e32d-0410-b094-e92efae38249

netconn.c

index e21c7152c87623158259f5b79af1ed513bb2f4ec..7ea599c7a540397675587489181a03cc3a6c0970 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -2244,7 +2244,12 @@ static int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, unsigned char *dat
                                        {
                                                size_t l = strlen(s);
                                                if(l)
+                                               {
+                                                       client_t *host_client_save = host_client;
                                                        Cmd_ExecuteString(s, src_command);
+                                                       host_client = host_client_save;
+                                                       // in case it is a command that changes host_client (like restart)
+                                               }
                                                s += l + 1;
                                        }
                                        rcon_redirect_buffer[rcon_redirect_bufferpos] = 0;