From 9900af38f58c84a90bd1a3830b9acd08438c46c5 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 1 Dec 2019 23:17:33 +0100 Subject: Fix #7847: Use ViewportSign coordinates for sign Kdtree coordinates (#7849) Ensure the same coordinates are used for station/town/player signs regardless of how the landscape changes below it after the coordinates were first determined. By keeping track of whether each ViewportSign is valid for Kdtree use (and only ever registering the viewport sign when the object is valid) a lot of code can be simplified and become more robust at the same time. --- src/signs_base.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/signs_base.h') diff --git a/src/signs_base.h b/src/signs_base.h index 1c677db17..e92a05e2f 100644 --- a/src/signs_base.h +++ b/src/signs_base.h @@ -19,12 +19,12 @@ typedef Pool SignPool; extern SignPool _sign_pool; struct Sign : SignPool::PoolItem<&_sign_pool> { - char *name; - ViewportSign sign; - int32 x; - int32 y; - int32 z; - Owner owner; // placed by this company. Anyone can delete them though. OWNER_NONE for gray signs from old games. + char *name; + TrackedViewportSign sign; + int32 x; + int32 y; + int32 z; + Owner owner; // placed by this company. Anyone can delete them though. OWNER_NONE for gray signs from old games. Sign(Owner owner = INVALID_OWNER); ~Sign(); -- cgit v1.2.3-54-g00ecf