(svn r14139) -Fix (r12044): GetSlopeZ() gets a virtual coordinate, not a tile.
authorfrosch
Sat, 23 Aug 2008 16:09:06 +0000
changeset 9982 d7eab194eaaf
parent 9981 56b0a90e9e89
child 9983 0b3758c42889
(svn r14139) -Fix (r12044): GetSlopeZ() gets a virtual coordinate, not a tile.
src/viewport.cpp
--- a/src/viewport.cpp	Sat Aug 23 12:29:41 2008 +0000
+++ b/src/viewport.cpp	Sat Aug 23 16:09:06 2008 +0000
@@ -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)