viewport.c
changeset 4339 0b1c9f47e69b
parent 4334 99abd73de061
child 4340 89b0ebfb7615
--- a/viewport.c	Mon Aug 21 16:35:47 2006 +0000
+++ b/viewport.c	Mon Aug 21 17:41:04 2006 +0000
@@ -1788,7 +1788,21 @@
 
 bool ScrollMainWindowTo(int x, int y)
 {
-	return ScrollWindowTo(x, y, FindWindowById(WC_MAIN_WINDOW, 0));
+	Window *w;
+	bool res = ScrollWindowTo(x, y, FindWindowById(WC_MAIN_WINDOW, 0));
+
+	/* 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,
+	 *  so you directly see where you are on the smallmap. */
+
+	if (res) return res;
+
+	w = FindWindowById(WC_SMALLMAP, 0);
+	if (w == NULL) return res;
+
+	SmallMapCenterOnCurrentPos(w);
+
+	return res;
 }