From 3bc5803595bf91439ca4805cec5f7f2bed0de72a Mon Sep 17 00:00:00 2001 From: ennewalker Date: Wed, 21 Jan 2009 03:58:34 +0000 Subject: [2496621] Fixing view recentering on abyss shifts. Shifts now preserve any scrolling that had occured. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8641 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 086782330c..c0dbe2af63 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -7214,13 +7214,12 @@ bool player::is_icy() const return (attribute[ATTR_TRANSFORMATION] == TRAN_ICE_BEAST); } -void player::moveto(const coord_def &c) +void player::base_moveto(const coord_def &c) { ASSERT(!crawl_state.arena); const bool real_move = (c != pos()); position = c; - crawl_view.set_player_at(c); if (real_move) { @@ -7233,6 +7232,18 @@ void player::moveto(const coord_def &c) } } +void player::moveto(const coord_def &c) +{ + crawl_view.set_player_at(c); + base_moveto(c); +} + +void player::shiftto(const coord_def &c) +{ + crawl_view.shift_player_to(c); + base_moveto(c); +} + void player::reset_prev_move() { prev_move = coord_def(0,0); -- cgit v1.2.3-54-g00ecf