Do not update viewport signs when running headlessly

This commit is contained in:
Jonathan G Rennison
2024-01-22 23:22:09 +00:00
parent 04e47eca9a
commit ced17a74e8
6 changed files with 9 additions and 1 deletions

View File

@@ -533,6 +533,7 @@ static bool IsCloseToTown(TileIndex tile, uint dist)
/** Resize the sign (label) of the town after it changes population. */
void Town::UpdateVirtCoord()
{
if (IsHeadless()) return;
this->UpdateLabel();
Point pt = RemapCoords2(TileX(this->xy) * TILE_SIZE, TileY(this->xy) * TILE_SIZE);
@@ -550,6 +551,7 @@ void Town::UpdateVirtCoord()
/** Update the virtual coords needed to draw the town sign for all towns. */
void UpdateAllTownVirtCoords()
{
if (IsHeadless()) return;
for (Town *t : Town::Iterate()) {
t->UpdateVirtCoord();
}