From: bones_was_here Date: Fri, 9 Feb 2024 08:12:34 +0000 (+1000) Subject: Fix changing of player name during a game X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=12ab81bae4a39b52e91b34cc35874fb2100bb5f9;p=xonotic%2Fdarkplaces.git Fix changing of player name during a game Name changes applied when connecting or when the map changed, but not during the game. I broke it in 74b49d6e5412af206448119963e0a4b3617e8ca4 by not noticing the user-visible name of the cvar is used to determine which command (if any) is sent. Signed-off-by: bones_was_here --- diff --git a/cl_cmd.c b/cl_cmd.c index 681b83c1..4556d2cf 100644 --- a/cl_cmd.c +++ b/cl_cmd.c @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "cl_collision.h" +/// User-visible names of these CF_USERINFO cvars must be matched in CL_SetInfo()! cvar_t cl_name = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "_cl_name", "player", "player name"}; cvar_t cl_rate = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate", "20000", "connection speed"}; cvar_t cl_rate_burstsize = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate_burstsize", "1024", "rate control burst size"}; @@ -37,6 +38,7 @@ cvar_t cl_team = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "team", "none", "QW team cvar_t cl_skin = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "skin", "", "QW player skin name (example: base)"}; cvar_t cl_noaim = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "noaim", "1", "QW option to disable vertical autoaim"}; cvar_t cl_pmodel = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "pmodel", "0", "current player model number in nehahra"}; + cvar_t r_fixtrans_auto = {CF_CLIENT, "r_fixtrans_auto", "0", "automatically fixtrans textures (when set to 2, it also saves the fixed versions to a fixtrans directory)"}; extern cvar_t rcon_secure; diff --git a/cl_main.c b/cl_main.c index cba1b756..efc6ba4d 100644 --- a/cl_main.c +++ b/cl_main.c @@ -257,7 +257,7 @@ void CL_SetInfo(const char *key, const char *value, qbool send, qbool allowstark MSG_WriteByte(&cls.netcon->message, qw_clc_stringcmd); MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "setinfo \"%s\" \"%s\"", key, value)); } - else if (!strcasecmp(key, "name")) + else if (!strcasecmp(key, "_cl_name") || !strcasecmp(key, "name")) { MSG_WriteByte(&cls.netcon->message, clc_stringcmd); MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "name \"%s\"", value));