changeset 9982:f8de45861659 draft

(svn r14139) -Fix (r12044): GetSlopeZ() gets a virtual coordinate, not a tile.
author frosch <frosch@openttd.org>
date Sat, 23 Aug 2008 16:09:06 +0000
parents ea1be9d59dc9
children 26c9b1fc707a
files src/viewport.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -2068,7 +2068,7 @@
 bool ScrollWindowTo(int x , int y, Window *w, bool instant)
 {
 	/* The slope cannot be acquired outside of the map, so make sure we are always within the map. */
-	Point pt = MapXYZToViewport(w->viewport, x, y, GetSlopeZ(Clamp(x, 0, MapSizeX()), Clamp(y, 0, MapSizeY())));
+	Point pt = MapXYZToViewport(w->viewport, x, y, GetSlopeZ(Clamp(x, 0, MapSizeX() * TILE_SIZE), Clamp(y, 0, MapSizeY() * TILE_SIZE)));
 	w->viewport->follow_vehicle = INVALID_VEHICLE;
 
 	if (w->viewport->dest_scrollpos_x == pt.x && w->viewport->dest_scrollpos_y == pt.y)