MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / RebuildTownKdtree

Function RebuildTownKdtree

src/town_cmd.cpp:78–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76TownKdtree _town_kdtree{};
77
78void RebuildTownKdtree()
79{
80 std::vector<TownID> townids;
81 for (const Town *town : Town::Iterate()) {
82 townids.push_back(town->index);
83 }
84 _town_kdtree.Build(townids.begin(), townids.end());
85}
86
87/** Set if a town is being generated. */
88static bool _generating_town = false;

Callers 5

InitializeGameFunction · 0.85
GenerateTownsFunction · 0.85
AfterLoadGameFunction · 0.85
RebuildTownCachesFunction · 0.85
RemapTownFunction · 0.85

Calls 4

push_backMethod · 0.80
BuildMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected