From: Mario Date: Sun, 29 Jan 2017 03:02:32 +0000 (+1000) Subject: Fix CTF rankings not acquiring player's name for the leaderboard X-Git-Tag: xonotic-v0.8.2~259^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=905b29ad0ad0caa326c09034738357b2c77d5af6;p=xonotic%2Fxonotic-data.pk3dir.git Fix CTF rankings not acquiring player's name for the leaderboard --- diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 147f16c4b..fa39b42ca 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -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);