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/town_cmd.cpp | |
parent | d84b67e54d663a62a0a90ddf3fcc7c3f728826af (diff) | |
download | openttd-e8d397e4ee71fa9aa952a16fc2f8431dfff57f7c.tar.xz |
Codechange: Make a merged k-d tree index of all viewport signs
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 0f1ccbba3..ee2f49d93 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -14,6 +14,7 @@ #include "road_cmd.h" #include "landscape.h" #include "viewport_func.h" +#include "viewport_kdtree.h" #include "cmd_helper.h" #include "command_func.h" #include "industry.h" @@ -1713,6 +1714,7 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize t->townnameparts = townnameparts; t->UpdateVirtCoord(); + _viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeTown(t->index)); InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 0); t->InitializeLayout(layout); @@ -2869,6 +2871,7 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* The town destructor will delete the other things related to the town. */ if (flags & DC_EXEC) { _town_kdtree.Remove(t->index); + _viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeTown(t->index)); delete t; } |