]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't send duration and countdown_num together with an empty msg, they are useless
authorterencehill <piuntn@gmail.com>
Tue, 28 Jun 2011 17:20:12 +0000 (19:20 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 28 Jun 2011 17:20:12 +0000 (19:20 +0200)
qcsrc/client/Main.qc
qcsrc/server/miscfunctions.qc

index 1f3c4d3bb5fa475ea6c9d89e70b96013390b8eb5..d4d1948d4cd88b5413e57cac46a64d2f3e61de4f 100644 (file)
@@ -1333,11 +1333,13 @@ void Net_Notify() {
        else if(type == CSQC_CENTERPRINT_GENERIC)
        {
                float id;
+               string s;
                id = ReadByte();
-               if (id == 0)
-                       centerprint_generic(id, ReadString(), 0, 0);
+               s = ReadString();
+               if (id != 0 && s != "")
+                       centerprint_generic(id, s, ReadByte(), ReadByte());
                else
-                       centerprint_generic(id, ReadString(), ReadByte(), ReadByte());
+                       centerprint_generic(id, s, 0, 0);
        }
 }
 
index ffbe00f0fe7d9a546cc619f4cb6111a4fd2ae844..982a996caea275841815db7b163c0fce9c4a6ef3 100644 (file)
@@ -1655,7 +1655,7 @@ void precache()
 #define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0
 
 
-void Send_CSQC_Centerprint_Generic(entity e, float id, string s1, float duration, float countdown_num)
+void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num)
 {
        if (clienttype(e) == CLIENTTYPE_REAL)
        {
@@ -1665,8 +1665,8 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s1, float duration
                        WriteByte(MSG_ONE, TE_CSQC_NOTIFY);
                        WriteByte(MSG_ONE, CSQC_CENTERPRINT_GENERIC);
                        WriteByte(MSG_ONE, id);
-                       WriteString(MSG_ONE, s1);
-                       if (id != 0)
+                       WriteString(MSG_ONE, s);
+                       if (id != 0 && s != "")
                        {
                                WriteByte(MSG_ONE, duration);
                                WriteByte(MSG_ONE, countdown_num);