From fc16e8523c1394347fcdd558775d9d8984ab4ec1 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 10 Oct 2017 22:01:06 +0200 Subject: [PATCH] Check for invisible name only when player name changes --- qcsrc/server/client.qc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 7754a1651..74bbeba54 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1217,8 +1217,6 @@ void ClientConnect(entity this) CS(this).just_joined = true; // stop spamming the eventlog with additional lines when the client connects - CS(this).netname_previous = strzone(this.netname); - if(teamplay && IS_PLAYER(this)) Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_JOIN_CONNECT_TEAM), this.netname); else @@ -2499,11 +2497,13 @@ void PlayerPreThink (entity this) zoomstate_set = false; // Check for nameless players - if (isInvisibleString(this.netname)) { - this.netname = strzone(sprintf("Player#%d", this.playerid)); - // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe? - } - if (this.netname != CS(this).netname_previous) { + if (this.netname == "" || this.netname != CS(this).netname_previous) + { + if (isInvisibleString(this.netname)) + { + this.netname = strzone(sprintf("Player#%d", this.playerid)); + // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe? + } if (autocvar_sv_eventlog) { GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this, false))); } -- 2.39.2