code cleanup
authorHolger Schemel <info@artsoft.org>
Fri, 3 Sep 2021 13:45:14 +0000 (15:45 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 3 Sep 2021 13:45:14 +0000 (15:45 +0200)
src/libgame/setup.c

index 60ec59f307cc83e9aaf332a86c5b85f16b13e73d..f1223d0dd238b0098f845f54b57f574d09b903c4 100644 (file)
@@ -1301,17 +1301,14 @@ static TreeInfo *getValidTreeInfoEntryExt(TreeInfo *node, boolean get_next_node)
   if (node->parent_link)       // skip first node (back link) of node group
     get_next_node = TRUE;
 
   if (node->parent_link)       // skip first node (back link) of node group
     get_next_node = TRUE;
 
-  if (get_next_node)
-  {
-    // get next regular tree node, or step up until one is found
-    while (node->next == NULL && node->node_parent != NULL)
-      node = node->node_parent;
+  if (!get_next_node)          // get current regular tree node
+    return node;
 
 
-    return getFirstValidTreeInfoEntry(node->next);
-  }
+  // get next regular tree node, or step up until one is found
+  while (node->next == NULL && node->node_parent != NULL)
+    node = node->node_parent;
 
 
-  // this is a regular tree node
-  return node;
+  return getFirstValidTreeInfoEntry(node->next);
 }
 
 TreeInfo *getFirstValidTreeInfoEntry(TreeInfo *node)
 }
 
 TreeInfo *getFirstValidTreeInfoEntry(TreeInfo *node)