(svn r11495) -Fix (r11493): some compilers fail to show warnings when they should.
authorrubidium
Thu, 22 Nov 2007 22:54:49 +0000
changeset 7942 39a55d50eb11
parent 7941 2cb6dd3c46ee
child 7943 8517bbaacb7e
(svn r11495) -Fix (r11493): some compilers fail to show warnings when they should.
src/openttd.cpp
--- a/src/openttd.cpp	Thu Nov 22 22:37:06 2007 +0000
+++ b/src/openttd.cpp	Thu Nov 22 22:54:49 2007 +0000
@@ -1246,8 +1246,6 @@
 bool AfterLoadGame()
 {
 	TileIndex map_size = MapSize();
-	Window *w;
-	ViewPort *vp;
 	Player *p;
 
 	/* in version 2.1 of the savegame, town owner was unified. */
@@ -1345,9 +1343,6 @@
 	if (!_players[0].is_active && (!_networking || (_networking && _network_server && !_network_dedicated)))
 		DoStartupNewPlayer(false);
 
-	DoZoomInOutWindow(ZOOM_NONE, w); // update button status
-	MarkWholeScreenDirty();
-
 	if (CheckSavegameVersion(72)) {
 		/* Locks/shiplifts in very old savegames had OWNER_WATER as owner */
 		for (TileIndex t = 0; t < MapSize(); t++) {
@@ -2195,18 +2190,21 @@
 	ResetWindowSystem();
 	SetupColorsAndInitialWindow();
 
-	w = FindWindowById(WC_MAIN_WINDOW, 0);
+	Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
 
-	WP(w,vp_d).scrollpos_x = _saved_scrollpos_x;
-	WP(w,vp_d).scrollpos_y = _saved_scrollpos_y;
-	WP(w,vp_d).dest_scrollpos_x = _saved_scrollpos_x;
-	WP(w,vp_d).dest_scrollpos_y = _saved_scrollpos_y;
+	WP(w, vp_d).scrollpos_x = _saved_scrollpos_x;
+	WP(w, vp_d).scrollpos_y = _saved_scrollpos_y;
+	WP(w, vp_d).dest_scrollpos_x = _saved_scrollpos_x;
+	WP(w, vp_d).dest_scrollpos_y = _saved_scrollpos_y;
 
-	vp = w->viewport;
+	ViewPort *vp = w->viewport;
 	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);
 
+	DoZoomInOutWindow(ZOOM_NONE, w); // update button status
+	MarkWholeScreenDirty();
+
 	/* Recalculate */
 	Group *g;
 	FOR_ALL_GROUPS(g) {