projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
767fdb2
)
fixed tree node navigation bug (when stepping up empty sub-trees)
author
Holger Schemel
<info@artsoft.org>
Fri, 3 Sep 2021 13:22:48 +0000
(15:22 +0200)
committer
Holger Schemel
<info@artsoft.org>
Fri, 3 Sep 2021 13:22:48 +0000
(15:22 +0200)
src/libgame/setup.c
patch
|
blob
|
history
diff --git
a/src/libgame/setup.c
b/src/libgame/setup.c
index dfd9ac612eb4127d6a0c4496bc1f9ee552f5c42e..403d0dae558baa641d5ebf618fb45a8e514fe9c3 100644
(file)
--- a/
src/libgame/setup.c
+++ b/
src/libgame/setup.c
@@
-1300,10
+1300,11
@@
TreeInfo *getFirstValidTreeInfoEntry(TreeInfo *node)
if (node->parent_link) // skip first node (back link) of node group
{
if (node->parent_link) // skip first node (back link) of node group
{
- if (node->next) // get next regular node
- return getFirstValidTreeInfoEntry(node->next);
- else // leave empty node group and go on
- return getFirstValidTreeInfoEntry(node->node_parent->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;
+
+ return getFirstValidTreeInfoEntry(node->next);
}
// this is a regular tree node
}
// this is a regular tree node