diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-02-22 17:57:28 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-03-09 20:27:11 +0100 |
commit | e8d397e4ee71fa9aa952a16fc2f8431dfff57f7c (patch) | |
tree | 0a7a80605221db6fc524e4995628bcc024d66aed /src/saveload | |
parent | d84b67e54d663a62a0a90ddf3fcc7c3f728826af (diff) | |
download | openttd-e8d397e4ee71fa9aa952a16fc2f8431dfff57f7c.tar.xz |
Codechange: Make a merged k-d tree index of all viewport signs
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index a80114f91..ea7882e89 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -19,6 +19,7 @@ #include "../network/network_func.h" #include "../gfxinit.h" #include "../viewport_func.h" +#include "../viewport_kdtree.h" #include "../industry.h" #include "../clear_map.h" #include "../vehicle_func.h" @@ -221,6 +222,7 @@ void UpdateAllVirtCoords() UpdateAllStationVirtCoords(); UpdateAllSignVirtCoords(); UpdateAllTownVirtCoords(); + RebuildViewportKdtree(); } /** @@ -538,6 +540,9 @@ bool AfterLoadGame() RebuildTownKdtree(); RebuildStationKdtree(); + /* This needs to be done even before conversion, because some conversions will destroy objects + * that otherwise won't exist in the tree. */ + RebuildViewportKdtree(); if (IsSavegameVersionBefore(SLV_98)) GamelogGRFAddList(_grfconfig); |