summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-03-25 20:01:55 +0000
committerGitHub <noreply@github.com>2019-03-25 20:01:55 +0000
commit698241e16e12bdb03cdc90bdf3d5a6ff631ae309 (patch)
treedb342641b53c9a95ab69f80eaf731906b0a6acc9
parenta4073895aeb0ceedd965ed691c2888500a542612 (diff)
downloadopenttd-698241e16e12bdb03cdc90bdf3d5a6ff631ae309.tar.xz
Fix #7410: Sign position/width not set on initial creation. (#7413)
Sign width was only updated when the text was changed. This seems to work for player-placed signs as there is always a rename operation, however AIs can create a sign with text in one go, in which case the width was never set.
-rw-r--r--src/signs_cmd.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp
index 69fde2559..e094e9e0f 100644
--- a/src/signs_cmd.cpp
+++ b/src/signs_cmd.cpp
@@ -58,6 +58,7 @@ CommandCost CmdPlaceSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
if (!StrEmpty(text)) {
si->name = stredup(text);
}
+ si->UpdateVirtCoord();
_viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeSign(si->index));
InvalidateWindowData(WC_SIGN_LIST, 0, 0);
_new_sign_id = si->index;