# HG changeset patch # User frosch # Date 1219507746 0 # Node ID d7eab194eaaf9971fe40182d12aea59fdf7aa7f6 # Parent 56b0a90e9e89f15dec4cf719354ce5b5ffdf1340 (svn r14139) -Fix (r12044): GetSlopeZ() gets a virtual coordinate, not a tile. diff -r 56b0a90e9e89 -r d7eab194eaaf 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)