X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsetup.c;h=f1223d0dd238b0098f845f54b57f574d09b903c4;hb=effd5d5c5bcf0edefb1bccf031510d9839d7789c;hp=60ec59f307cc83e9aaf332a86c5b85f16b13e73d;hpb=e3eb198296f9af373fa51c7a30f3a9ae27870808;p=rocksndiamonds.git diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 60ec59f3..f1223d0d 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -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 (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)