From: Holger Schemel Date: Fri, 3 Sep 2021 13:45:14 +0000 (+0200) Subject: code cleanup X-Git-Tag: 4.3.0.0~82 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=6a7a0a43f66ae9add076ccc55b859197567f879a code cleanup --- 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)