summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/view.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-08 21:53:05 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-08 21:53:05 +0000
commit7cc66e61e50963ba90a5db8db19cf75890d3c733 (patch)
treefa2ee702c472095c0c3c2326fd7920d02875e29a /crawl-ref/source/view.cc
parent8cbb227becdc172839b901aedf972022dc73118d (diff)
downloadcrawl-ref-7cc66e61e50963ba90a5db8db19cf75890d3c733.tar.gz
crawl-ref-7cc66e61e50963ba90a5db8db19cf75890d3c733.zip
Apply more commits into 0.4 branch, again mostly by Haran:
6950, 6954, 6959, 6962, 6963, 6965, 6968, 6970 (partly), 6997, 6998, 7001, 7061, 7065, 7071, 7132 (partly), 7174, 7186, 7213, 7233, 7268, 7268, 7293, 7319, 7339, 7358, 7393 (partly) * Tweak a few monster flags. * Fix autoswapping jewellery taking longer than manual swapping. * Fix crash when attempting to create nonexisting monster in wizmode. * Make ego armour descriptions follow abbreviation guidelines. * Fixed buggy monster movement away from the player. * Disabled traps in the Abyss. * Fixed a few other minor bugs, and improves messaging. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@7788 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r--crawl-ref/source/view.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index efe1e7bb3d..0fba5ac35b 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -3139,7 +3139,7 @@ void show_map( coord_def &spec_place, bool travel_mode )
arrange_features(features);
}
- char min_x = 80, max_x = 0, min_y = 0, max_y = 0;
+ int min_x = GXM, max_x = 0, min_y = 0, max_y = 0;
bool found_y = false;
const int num_lines = _get_number_of_lines_levelmap();
@@ -3534,13 +3534,17 @@ void show_map( coord_def &spec_place, bool travel_mode )
{
// Scrolling only happens when we don't have a large enough
// display to show the known map.
- if (scroll_y < 0 && ((screen_y += scroll_y) <= min_y + half_screen))
- screen_y = min_y + half_screen;
-
- if (scroll_y > 0 && ((screen_y += scroll_y) >= max_y - half_screen))
- screen_y = max_y - half_screen;
-
- scroll_y = 0;
+ if (scroll_y != 0)
+ {
+ const int old_screen_y = screen_y;
+ screen_y += scroll_y;
+ if (scroll_y < 0)
+ screen_y = std::max(screen_y, min_y + half_screen);
+ else
+ screen_y = std::min(screen_y, max_y - half_screen);
+ curs_y -= (screen_y - old_screen_y);
+ scroll_y = 0;
+ }
if (curs_y + move_y < 1)
{