From: Holger Schemel Date: Tue, 20 Oct 2020 21:55:36 +0000 (+0200) Subject: fixed bug with not updating list of user names when typing name X-Git-Tag: 4.2.1.0~19 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a9867972b01e498db5de48df007f327cce3ff561;p=rocksndiamonds.git fixed bug with not updating list of user names when typing name This bug occurs when setup option "multiple users" is disabled and the player name is changed in the main menu -- when done, enabling multiple users in the setup menu and entering the name selection screen shows that the current player name that was just changed is not updated in the list of user names shown on the name selection screen. --- diff --git a/src/screens.c b/src/screens.c index e9be137b..eab76ecc 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4056,6 +4056,7 @@ static void getTypeNameValues(char *name, struct TextPosInfo *pos, int *xpos) int font_width = getFontWidth(pos->font); type_name_node = getTreeInfoFromPos(node_first, entry_pos); + type_name_nr = entry_pos; strcpy(name, type_name_node->name); @@ -4065,6 +4066,8 @@ static void getTypeNameValues(char *name, struct TextPosInfo *pos, int *xpos) } else { + type_name_nr = user.nr; + strcpy(name, setup.player_name); } @@ -4104,13 +4107,11 @@ static void setTypeNameValues(char *name, struct TextPosInfo *pos, int last_user_nr = user.nr; + // change name of edited user in global list of user names + setString(&global.user_names[type_name_nr], name); + if (setup.multiple_users) { - type_name_nr = posTreeInfo(node); - - // change name of edited user in global list of user names - setString(&global.user_names[type_name_nr], name); - // change name of edited user in local menu tree structure setString(&node->name, name); setString(&node->name_sorting, name);