diff options
author | frosch <frosch@openttd.org> | 2008-08-23 16:09:06 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-08-23 16:09:06 +0000 |
commit | a7bc5f2d0d0e917969e56897e0ee7bc07fdee4b9 (patch) | |
tree | e96e399c9996a58cfc0afc82562dbb348b924c9e /src | |
parent | 983a93d447be34d4b4f829e003c1071a1a6fc8d2 (diff) | |
download | openttd-a7bc5f2d0d0e917969e56897e0ee7bc07fdee4b9.tar.xz |
(svn r14139) -Fix (r12044): GetSlopeZ() gets a virtual coordinate, not a tile.
Diffstat (limited to 'src')
-rw-r--r-- | src/viewport.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 9e54e21d7..78dc2a0bf 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2068,7 +2068,7 @@ void PlaceObject() 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) |