forked from mirror/OpenTTD
(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)
This commit is contained in:
@@ -64,11 +64,14 @@ void UpdateAllSignVirtCoords()
|
|||||||
*/
|
*/
|
||||||
static void MarkSignDirty(Sign *si)
|
static void MarkSignDirty(Sign *si)
|
||||||
{
|
{
|
||||||
|
/* 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(
|
MarkAllViewportsDirty(
|
||||||
si->sign.left - 6,
|
si->sign.left - 6,
|
||||||
si->sign.top - 3,
|
si->sign.top - 3,
|
||||||
si->sign.left + ScaleByZoom(si->sign.width_1 + 12, _cur_dpi->zoom),
|
si->sign.left + ScaleByZoom(si->sign.width_1 + 12, ZOOM_LVL_MAX),
|
||||||
si->sign.top + ScaleByZoom(12, _cur_dpi->zoom));
|
si->sign.top + ScaleByZoom(12, ZOOM_LVL_MAX));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -122,11 +122,14 @@ void Station::MarkDirty() const
|
|||||||
if (sign.width_1 != 0) {
|
if (sign.width_1 != 0) {
|
||||||
InvalidateWindowWidget(WC_STATION_VIEW, index, 1);
|
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(
|
MarkAllViewportsDirty(
|
||||||
sign.left - 6,
|
sign.left - 6,
|
||||||
sign.top,
|
sign.top,
|
||||||
sign.left + ScaleByZoom(sign.width_1 + 12, _cur_dpi->zoom),
|
sign.left + ScaleByZoom(sign.width_1 + 12, ZOOM_LVL_MAX),
|
||||||
sign.top + ScaleByZoom(12, _cur_dpi->zoom));
|
sign.top + ScaleByZoom(12, ZOOM_LVL_MAX));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user