diff options
author | smatz <smatz@openttd.org> | 2009-03-15 15:25:18 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-03-15 15:25:18 +0000 |
commit | af293142fede91cc31e98c7e05d9ecfef752b077 (patch) | |
tree | c041152a492c41b5020c575b6fde72be6dc3a5b8 /src/smallmap_gui.cpp | |
parent | 4f8eeca437a57c160364cdb97182ae1566e6c693 (diff) | |
download | openttd-af293142fede91cc31e98c7e05d9ecfef752b077.tar.xz |
(svn r15725) -Fix: centering on a vehicle didn't respect its z coordinate
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r-- | src/smallmap_gui.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 0619f4039..1d5c2baca 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1214,9 +1214,17 @@ void ShowExtraViewPortWindow(TileIndex tile) new ExtraViewportWindow(&_extra_view_port_desc, i, tile); } -bool ScrollMainWindowTo(int x, int y, bool instant) +/** + * Scrolls the main window to given coordinates. + * @param x x coordinate + * @param y y coordinate + * @param z z coordinate; -1 to scroll to terrain height + * @param instant scroll instantly (meaningful only when smooth_scrolling is active) + * @return did the viewport position change? + */ +bool ScrollMainWindowTo(int x, int y, int z, bool instant) { - bool res = ScrollWindowTo(x, y, FindWindowById(WC_MAIN_WINDOW, 0), instant); + bool res = ScrollWindowTo(x, y, z, FindWindowById(WC_MAIN_WINDOW, 0), instant); /* If a user scrolls to a tile (via what way what so ever) and already is on * that tile (e.g.: pressed twice), move the smallmap to that location, |