Which root time did you intend here?

`tree->nodes[tree->root].child[0]` is the root of the "subtree", `...child[1]` would give the root of the "maintree".  Maybe doing this in two steps would be more clear, like:
```c++
int subtree_root = tree->nodes[tree->root].child[0];
root_time = max(tree->nodes[subtree_root].age, state.time);
```