From: terencehill Date: Sun, 15 Oct 2017 11:11:20 +0000 (+0200) Subject: Fix event log reporting a name change event on connect X-Git-Tag: xonotic-v0.8.5~2445 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b033eeb472dde42a24c46120ea2db8591ef5213c;p=xonotic%2Fxonotic-data.pk3dir.git Fix event log reporting a name change event on connect --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 74bbeba54..45e71d559 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2492,21 +2492,22 @@ void PlayerPreThink (entity this) // WORKAROUND: only use dropclient in server frames (frametime set). // Never use it in cl_movement frames (frametime zero). checkSpectatorBlock(this); - } + } zoomstate_set = false; // Check for nameless players if (this.netname == "" || this.netname != CS(this).netname_previous) { + bool assume_unchanged = (CS(this).netname_previous == ""); if (isInvisibleString(this.netname)) { this.netname = strzone(sprintf("Player#%d", this.playerid)); + assume_unchanged = false; // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe? } - if (autocvar_sv_eventlog) { + if (!assume_unchanged && autocvar_sv_eventlog) GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this, false))); - } if (CS(this).netname_previous) strunzone(CS(this).netname_previous); CS(this).netname_previous = strzone(this.netname); }