summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-17 13:27:50 +0000
committerrubidium <rubidium@openttd.org>2007-06-17 13:27:50 +0000
commit5fdde681c2aff0976eef8cea59422332527b3a65 (patch)
tree18e58a81e4561b861e81298d76f725f85fe2f88a /src
parent6c67bdcc71401934195e7c6fe6920a21c3b3ac71 (diff)
downloadopenttd-5fdde681c2aff0976eef8cea59422332527b3a65.tar.xz
(svn r10181) -Fix (r10093): clamp the zoom level so it won't try to use a wrong zoom level when loading an old savegame.
Diffstat (limited to 'src')
-rw-r--r--src/openttd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 72dc622db..22302146b 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1306,7 +1306,7 @@ bool AfterLoadGame()
WP(w,vp_d).dest_scrollpos_y = _saved_scrollpos_y;
vp = w->viewport;
- vp->zoom = _saved_scrollpos_zoom;
+ vp->zoom = (ZoomLevel)min(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);