(svn r15725) -Fix: centering on a vehicle didn't respect its z coordinate

This commit is contained in:
smatz
2009-03-15 15:25:18 +00:00
parent 57c5ce84eb
commit d28895c88b
8 changed files with 25 additions and 15 deletions

View File

@@ -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,