]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - misc/source/darkplaces-src/console.c
Update the darkplaces engine source
[voretournament/voretournament.git] / misc / source / darkplaces-src / console.c
index 14175b07ad4c37cd84ea4e0202c438c43365c098..e21f2cbfb4c88abb54e51b0f49ad3a4d3a6fc390 100644 (file)
@@ -590,7 +590,8 @@ void Con_ClearNotify (void)
 {
        int i;
        for(i = 0; i < CON_LINES_COUNT; ++i)
-               CON_LINES(i).mask |= CON_MASK_HIDENOTIFY;
+               if(!(CON_LINES(i).mask & CON_MASK_CHAT))
+                       CON_LINES(i).mask |= CON_MASK_HIDENOTIFY;
 }
 
 
@@ -905,13 +906,16 @@ void Con_Rcon_Redirect_Init(lhnetsocket_t *sock, lhnetaddress_t *dest, qboolean
 
 static void Con_Rcon_Redirect_Flush(void)
 {
-       rcon_redirect_buffer[rcon_redirect_bufferpos] = 0;
-       if (rcon_redirect_proquakeprotocol)
+       if(rcon_redirect_sock)
        {
-               // update the length in the packet header
-               StoreBigLong((unsigned char *)rcon_redirect_buffer, NETFLAG_CTL | (rcon_redirect_bufferpos & NETFLAG_LENGTH_MASK));
+               rcon_redirect_buffer[rcon_redirect_bufferpos] = 0;
+               if (rcon_redirect_proquakeprotocol)
+               {
+                       // update the length in the packet header
+                       StoreBigLong((unsigned char *)rcon_redirect_buffer, NETFLAG_CTL | (rcon_redirect_bufferpos & NETFLAG_LENGTH_MASK));
+               }
+               NetConn_Write(rcon_redirect_sock, rcon_redirect_buffer, rcon_redirect_bufferpos, rcon_redirect_dest);
        }
-       NetConn_Write(rcon_redirect_sock, rcon_redirect_buffer, rcon_redirect_bufferpos, rcon_redirect_dest);
        memcpy(rcon_redirect_buffer, "\377\377\377\377n", 5); // QW rcon print
        rcon_redirect_bufferpos = 5;
        rcon_redirect_proquakeprotocol = false;
@@ -2053,11 +2057,10 @@ qboolean GetMapList (const char *s, char *completedname, int completednamebuffer
                                        lumplen = LittleLong(header->lumps[Q2LUMP_ENTITIES].filelen);
                                }
                        }
-                       else if((p = BuffLittleLong(buf)) == BSPVERSION || p == 30)
+                       else if((p = BuffLittleLong(buf)) == BSPVERSION || p == 30 || !memcmp(buf, "BSP2", 4))
                        {
-                               dheader_t *header = (dheader_t *)buf;
-                               lumpofs = LittleLong(header->lumps[LUMP_ENTITIES].fileofs);
-                               lumplen = LittleLong(header->lumps[LUMP_ENTITIES].filelen);
+                               lumpofs = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES);
+                               lumplen = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES + 4);
                        }
                        else
                                p = 0;
@@ -2482,7 +2485,7 @@ static void Nicks_CutMatchesAlphaNumeric(int count)
        if(Nicks_strcleanlen(Nicks_sanlist[0]) < strlen(tempstr))
        {
                // if the clean sanitized one is longer than the current one, use it, it has crap chars which definitely are in there
-               strlcpy(Nicks_sanlist[0], tempstr, sizeof(tempstr));
+               strlcpy(Nicks_sanlist[0], tempstr, sizeof(Nicks_sanlist[0]));
        }
 }
 
@@ -2538,7 +2541,7 @@ static void Nicks_CutMatchesNoSpaces(int count)
        if(Nicks_strcleanlen(Nicks_sanlist[0]) < strlen(tempstr))
        {
                // if the clean sanitized one is longer than the current one, use it, it has crap chars which definitely are in there
-               strlcpy(Nicks_sanlist[0], tempstr, sizeof(tempstr));
+               strlcpy(Nicks_sanlist[0], tempstr, sizeof(Nicks_sanlist[0]));
        }
 }