Codechange: Improve performance of evaluating group hierarchy.

Store a list of child groups in each group, to avoid having to iterate the group pool to find its children.
This commit is contained in:
Peter Nelson
2025-05-21 17:14:28 +01:00
committed by Peter Nelson
parent 8f3f25de4b
commit 000a79c093
3 changed files with 63 additions and 23 deletions

View File

@@ -575,6 +575,9 @@ bool AfterLoadGame()
* that otherwise won't exist in the tree. */
RebuildViewportKdtree();
/* Group hierarchy may be evaluated during conversion, so ensure its correct early on. */
UpdateGroupChildren();
if (IsSavegameVersionBefore(SLV_98)) _gamelog.GRFAddList(_grfconfig);
if (IsSavegameVersionBefore(SLV_119)) {