(svn r10181) -Fix (r10093): clamp the zoom level so it won't try to use a wrong zoom level when loading an old savegame.
authorrubidium
Sun, 17 Jun 2007 13:27:50 +0000
changeset 6928 f1d8bf0d6f45
parent 6927 0481975ce511
child 6929 56470c1b8a66
(svn r10181) -Fix (r10093): clamp the zoom level so it won't try to use a wrong zoom level when loading an old savegame.
src/openttd.cpp
--- a/src/openttd.cpp	Sun Jun 17 13:26:19 2007 +0000
+++ b/src/openttd.cpp	Sun Jun 17 13:27:50 2007 +0000
@@ -1306,7 +1306,7 @@
 	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);