From: Mario Date: Fri, 13 Oct 2017 01:29:50 +0000 (+1000) Subject: Move netname_previous out of ClientState (possible fix for IRC bots showing a name... X-Git-Tag: xonotic-v0.8.5~2449 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=be5f54b21773c4043ef4395d288765e5ff69509e;p=xonotic%2Fxonotic-data.pk3dir.git Move netname_previous out of ClientState (possible fix for IRC bots showing a name change every match) --- 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);