From be5f54b21773c4043ef4395d288765e5ff69509e Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 13 Oct 2017 11:29:50 +1000 Subject: [PATCH] Move netname_previous out of ClientState (possible fix for IRC bots showing a name change every match) --- qcsrc/server/client.qc | 9 +++++---- qcsrc/server/client.qh | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 74bbeba54..823bb4802 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1304,6 +1304,7 @@ Called when a client disconnects from the server ============= */ .entity chatbubbleentity; +.string netname_previous; void ReadyCount(); void ClientDisconnect(entity this) { @@ -1324,7 +1325,7 @@ void ClientDisconnect(entity this) MUTATOR_CALLHOOK(ClientDisconnect, this); - if (CS(this).netname_previous) strunzone(CS(this).netname_previous); // needs to be before the CS entity is removed! + if (this.netname_previous) strunzone(this.netname_previous); // needs to be before the CS entity is removed! ClientState_detach(this); Portal_ClearAll(this); @@ -2497,7 +2498,7 @@ void PlayerPreThink (entity this) zoomstate_set = false; // Check for nameless players - if (this.netname == "" || this.netname != CS(this).netname_previous) + if (this.netname == "" || this.netname != this.netname_previous) { if (isInvisibleString(this.netname)) { @@ -2507,8 +2508,8 @@ void PlayerPreThink (entity this) if (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); + if (this.netname_previous) strunzone(this.netname_previous); + this.netname_previous = strzone(this.netname); } // version nagging diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 2282c09cb..71df6e98c 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -87,7 +87,6 @@ CLASS(Client, Object) ATTRIB(Client, jointime, float, this.jointime); ATTRIB(Client, spectatortime, float, this.spectatortime); ATTRIB(Client, version_nagtime, float, this.version_nagtime); - ATTRIB(Client, netname_previous, string, this.netname_previous); ATTRIB(Client, allowed_timeouts, int, this.allowed_timeouts); ATTRIB(Client, active_minigame, entity, this.active_minigame); ATTRIB(Client, taunt_soundtime, float, this.taunt_soundtime); -- 2.39.2