]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix event log reporting a name change event on connect
authorterencehill <piuntn@gmail.com>
Sun, 15 Oct 2017 11:11:20 +0000 (13:11 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 15 Oct 2017 11:11:20 +0000 (13:11 +0200)
qcsrc/server/client.qc

index 74bbeba54e66229796cacdecf9cf58d631febdbd..45e71d5591389cdeaef0d000d44d240c16a707b1 100644 (file)
@@ -2492,21 +2492,22 @@ void PlayerPreThink (entity this)
                // WORKAROUND: only use dropclient in server frames (frametime set).
                // Never use it in cl_movement frames (frametime zero).
                checkSpectatorBlock(this);
-    }
+       }
 
        zoomstate_set = false;
 
        // Check for nameless players
        if (this.netname == "" || this.netname != CS(this).netname_previous)
        {
+               bool assume_unchanged = (CS(this).netname_previous == "");
                if (isInvisibleString(this.netname))
                {
                        this.netname = strzone(sprintf("Player#%d", this.playerid));
+                       assume_unchanged = false;
                        // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
                }
-               if (autocvar_sv_eventlog) {
+               if (!assume_unchanged && 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);
        }