From c3223903ed4f39abe8589355882b30b973da434e Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 6 Jan 2020 20:40:31 +0000 Subject: Codechange: Cache resolved town, station and industry name strings --- src/saveload/afterload.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/saveload') diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index c37c297c5..022fd28e9 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -222,6 +222,13 @@ void UpdateAllVirtCoords() RebuildViewportKdtree(); } +void ClearAllCachedNames() +{ + ClearAllStationCachedNames(); + ClearAllTownCachedNames(); + ClearAllIndustryCachedNames(); +} + /** * Initialization of the windows and several kinds of caches. * This is not done directly in AfterLoadGame because these @@ -238,6 +245,7 @@ static void InitializeWindowsAndCaches() SetupColoursAndInitialWindow(); /* Update coordinates of the signs. */ + ClearAllCachedNames(); UpdateAllVirtCoords(); ResetViewportAfterLoadGame(); -- cgit v1.2.3-54-g00ecf