summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-05-26 12:19:54 +0000
committertruelight <truelight@openttd.org>2007-05-26 12:19:54 +0000
commit79fe6c57cce16e78db5e1014e02cfc2f477d9c31 (patch)
treed0159c6e3f538683ed5e469db71b7aeb536b6a7a /src/station.cpp
parent78be11be407f7496d57d40f4d866942192b6166b (diff)
downloadopenttd-79fe6c57cce16e78db5e1014e02cfc2f477d9c31.tar.xz
(svn r9932) -Fix: can't assume a zoom-level with MarkAllViewportsDirty, causing segfaults when trying to load savegames in dedicated server via -g (reported by peter1138)
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 2c17406f0..2234e8417 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -122,11 +122,14 @@ void Station::MarkDirty() const
if (sign.width_1 != 0) {
InvalidateWindowWidget(WC_STATION_VIEW, index, 1);
+ /* We use ZOOM_LVL_MAX here, as every viewport can have an other zoom,
+ * and there is no way for us to know which is the biggest. So make the
+ * biggest area dirty, and we are safe for sure. */
MarkAllViewportsDirty(
sign.left - 6,
sign.top,
- sign.left + ScaleByZoom(sign.width_1 + 12, _cur_dpi->zoom),
- sign.top + ScaleByZoom(12, _cur_dpi->zoom));
+ sign.left + ScaleByZoom(sign.width_1 + 12, ZOOM_LVL_MAX),
+ sign.top + ScaleByZoom(12, ZOOM_LVL_MAX));
}
}