]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move netname_previous out of ClientState (possible fix for IRC bots showing a name...
authorMario <mario@smbclan.net>
Fri, 13 Oct 2017 01:29:50 +0000 (11:29 +1000)
committerMario <mario@smbclan.net>
Fri, 13 Oct 2017 01:29:50 +0000 (11:29 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh

index 74bbeba54e66229796cacdecf9cf58d631febdbd..823bb48027e22b279dfb93e1388e8dc18eaa93ba 100644 (file)
@@ -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
index 2282c09cbb1cafd54e3a667886430b98b554c342..71df6e98c654e9d8d3488fa2a97fc0e0b77a937e 100644 (file)
@@ -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);