From a70a5f90e06701ab9631f993c59bd65b0072cc37 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 28 Jun 2011 19:20:12 +0200 Subject: [PATCH] Don't send duration and countdown_num together with an empty msg, they are useless --- qcsrc/client/Main.qc | 8 +++++--- qcsrc/server/miscfunctions.qc | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 1f3c4d3bb..d4d1948d4 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -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); } } diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index ffbe00f0f..982a996ca 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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); -- 2.39.2