]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Move netname_previous out of ClientState (possible fix for IRC bots showing a name...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
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