summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 2234e8417..9ddebb10e 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -133,7 +133,7 @@ void Station::MarkDirty() const
}
}
-void Station::MarkTilesDirty() const
+void Station::MarkTilesDirty(bool cargo_change) const
{
TileIndex tile = train_tile;
int w, h;
@@ -141,6 +141,15 @@ void Station::MarkTilesDirty() const
/* XXX No station is recorded as 0, not INVALID_TILE... */
if (tile == 0) return;
+ /* cargo_change is set if we're refreshing the tiles due to cargo moving
+ * around. */
+ if (cargo_change) {
+ /* Don't waste time updating if there are no custom station graphics
+ * that might change. Even if there are custom graphics, they might
+ * not change. Unfortunately we have no way of telling. */
+ if (this->num_specs == 0) return;
+ }
+
for (h = 0; h < trainst_h; h++) {
for (w = 0; w < trainst_w; w++) {
if (TileBelongsToRailStation(tile)) {