]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix CTF rankings not acquiring player's name for the leaderboard
authorMario <mario@smbclan.net>
Sun, 29 Jan 2017 03:02:32 +0000 (13:02 +1000)
committerMario <mario@smbclan.net>
Sun, 29 Jan 2017 03:02:32 +0000 (13:02 +1000)
qcsrc/server/mutators/mutator/gamemode_ctf.qc

index 147f16c4bfbb1ba906fe9f90f67b3b059f81d066..fa39b42cad102d31c23b15c21643a158fbc6a8fb 100644 (file)
@@ -2189,6 +2189,26 @@ MUTATOR_HOOKFUNCTION(ctf, ClientConnect)
        }
 }
 
+MUTATOR_HOOKFUNCTION(ctf, GetPressedKeys)
+{
+       if(!autocvar_g_ctf_leaderboard)
+               return;
+
+       entity player = M_ARGV(0, entity);
+
+       if(player.cvar_cl_allow_uidtracking == 1 && player.cvar_cl_allow_uid2name == 1)
+       {
+               if (!player.stored_netname)
+                       player.stored_netname = strzone(uid2name(player.crypto_idfp));
+               if(player.stored_netname != player.netname)
+               {
+                       db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
+                       strunzone(player.stored_netname);
+                       player.stored_netname = strzone(player.netname);
+               }
+       }
+}
+
 MUTATOR_HOOKFUNCTION(ctf, PortalTeleport)
 {
        entity player = M_ARGV(0, entity);