Skip to content

Commit

Permalink
Fix OpenTTD#7410: Sign position/width not set on initial creation.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PeterN committed Mar 25, 2019
1 parent 37b9fdc commit a9ea3a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/signs_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a9ea3a0

Please sign in to comment.