]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
remove quotes on say commands at the server end (like it used to, this is done a...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Oct 2004 03:08:00 +0000 (03:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Oct 2004 03:08:00 +0000 (03:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4618 d7cf8633-e32d-0410-b094-e92efae38249

host_cmd.c

index 9a0cc2a0c99c620ba0b053161ffc1e5563e03274..ca619b7fe294862f8b3e2f014f296e0800570d40 100644 (file)
@@ -786,8 +786,9 @@ void Host_Version_f (void)
 void Host_Say(qboolean teamonly)
 {
        client_t *save;
-       int j;
+       int j, quoted;
        const char *p1;
+       char *p2;
        // LordHavoc: 256 char say messages
        unsigned char text[256];
        qboolean fromServer = false;
@@ -814,10 +815,24 @@ void Host_Say(qboolean teamonly)
 
 // turn on color set 1
        p1 = Cmd_Args();
+       quoted = false;
+       if (*p1 == '\"')
+       {
+               quoted = true;
+               p1++;
+       }
        if (!fromServer)
-               snprintf (text, sizeof(text), "%c%s: %s\n", 1, host_client->name, p1);
+               snprintf (text, sizeof(text), "%c%s: %s", 1, host_client->name, p1);
        else
-               snprintf (text, sizeof(text), "%c<%s> %s\n", 1, hostname.string, p1);
+               snprintf (text, sizeof(text), "%c<%s> %s", 1, hostname.string, p1);
+       p2 = text + strlen(text);
+       while ((const char *)p2 > (const char *)text && (p2[-1] == '\r' || p2[-1] == '\n' || (p2[-1] == '\"' && quoted)))
+       {
+               if (p2[-1] == '\"' && quoted)
+                       quoted = false;
+               p2[-1] = 0;
+               p2--;
+       }
 
        // note: save is not a valid edict if fromServer is true
        save = host_client;