Codechange: Pass preformatted string when updating sign positions. (#13480)

This forces the strings to be formatted in advance and avoids using global string parameters.
This commit is contained in:
Peter Nelson
2025-02-07 13:19:00 +00:00
committed by GitHub
parent eaa765d615
commit 8c48f9fc49
7 changed files with 16 additions and 24 deletions

View File

@@ -44,8 +44,7 @@ void Waypoint::UpdateVirtCoord()
Point pt = RemapCoords2(TileX(this->xy) * TILE_SIZE, TileY(this->xy) * TILE_SIZE);
if (this->sign.kdtree_valid) _viewport_sign_kdtree.Remove(ViewportSignKdtreeItem::MakeWaypoint(this->index));
SetDParam(0, this->index);
this->sign.UpdatePosition(pt.x, pt.y - 32 * ZOOM_BASE, STR_WAYPOINT_NAME);
this->sign.UpdatePosition(pt.x, pt.y - 32 * ZOOM_BASE, GetString(STR_WAYPOINT_NAME, this->index));
_viewport_sign_kdtree.Insert(ViewportSignKdtreeItem::MakeWaypoint(this->index));