From fbec99ff9fcfd714907ec1c3c24f16dfd1d8961e Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 1 Jul 2011 12:20:58 +0000 Subject: [PATCH] Small workaround for excessive spam. This is not an actual fix, but more of an optimisation. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3843 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/cvar.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/engine/common/cvar.c b/engine/common/cvar.c index 588228c61..345b97c62 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -659,9 +659,13 @@ cvar_t *Cvar_SetCore (cvar_t *var, const char *value, qboolean force) #ifndef CLIENTONLY if (var->flags & CVAR_SERVERINFO) { - Info_SetValueForKey (svs.info, var->name, value, MAX_SERVERINFO_STRING); - SV_SendServerInfoChange(var->name, value); -// SV_BroadcastCommand ("fullserverinfo \"%s\"\n", svs.info); + char *old = Info_ValueForKey(svs.info, var->name); + if (strcmp(old, value)) //only spam the server if it actually changed + { + Info_SetValueForKey (svs.info, var->name, value, MAX_SERVERINFO_STRING); + SV_SendServerInfoChange(var->name, value); +// SV_BroadcastCommand ("fullserverinfo \"%s\"\n", svs.info); + } } #endif #ifndef SERVERONLY