added variable to improve readability
authorHolger Schemel <info@artsoft.org>
Mon, 19 Oct 2020 19:27:19 +0000 (21:27 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 13 Dec 2020 23:57:58 +0000 (00:57 +0100)
src/screens.c

index f2f385e89adda9d219a9e235a6cbcd46bd515848..3b9504bc0d23682859a96ededc5c76c6c9205e2a 100644 (file)
@@ -4058,6 +4058,8 @@ static void getTypeNameValues(char *name, struct TextPosInfo *pos, int *xpos)
 
 static void setTypeNameValues(char *name, int *font, boolean success)
 {
+  TreeInfo *node = type_name_node;
+
   if (!success)
     strcpy(name, type_name_last);
 
@@ -4066,18 +4068,18 @@ static void setTypeNameValues(char *name, int *font, boolean success)
 
   if (setup.multiple_users)
   {
-    if (type_name_node == NULL)                // should not happen
+    if (node == NULL)          // should not happen
       return;
 
     if (success)
     {
-      type_name_node->color = FC_RED;
+      node->color = FC_RED;
 
       if (strEqual(name, EMPTY_PLAYER_NAME))
-       type_name_node->color = FC_BLUE;
+       node->color = FC_BLUE;
     }
 
-    *font = FONT_TEXT_1 + type_name_node->color;
+    *font = FONT_TEXT_1 + node->color;
   }
 
   if (!success)
@@ -4090,14 +4092,14 @@ static void setTypeNameValues(char *name, int *font, boolean success)
 
   if (setup.multiple_users)
   {
-    int edit_user_nr = posTreeInfo(type_name_node);
+    int edit_user_nr = posTreeInfo(node);
 
     // change name of edited user in global list of user names
     setString(&global.user_names[edit_user_nr], name);
 
     // change name of edited user in local menu tree structure
-    setString(&type_name_node->name, name);
-    setString(&type_name_node->name_sorting, name);
+    setString(&node->name, name);
+    setString(&node->name_sorting, name);
 
     // save setup of currently active user (may differ from edited user)
     SaveSetup();