src/station.cpp
changeset 7319 f884be171f04
parent 7196 2659a044f6f7
child 7506 e52d89f5c7c1
--- a/src/station.cpp	Fri Jun 08 06:27:58 2007 +0000
+++ b/src/station.cpp	Fri Jun 08 09:35:39 2007 +0000
@@ -133,7 +133,7 @@
 	}
 }
 
-void Station::MarkTilesDirty() const
+void Station::MarkTilesDirty(bool cargo_change) const
 {
 	TileIndex tile = train_tile;
 	int w, h;
@@ -141,6 +141,15 @@
 	/* 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)) {