From a75a924ca5f67336d9e065ab307d976c4cd8fabc Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 4 Jun 2007 06:53:25 +0000 Subject: [1699948] Allow changing the viewport size if you're using a larger terminal than 80x24. Also allow moving the PC around the viewport without scrolling the viewport if the viewport is large enough. This is not tested on DOS and Windows yet. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1524 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells3.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/spells3.cc') diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 548aa5de9f..8394a1c4f6 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -662,8 +662,7 @@ static bool teleport_player( bool allow_control, bool new_abyss_area ) if (is_controlled) { - you.x_pos = plox[0]; - you.y_pos = plox[1]; + you.moveto(plox[0], plox[1]); if ((grd[you.x_pos][you.y_pos] != DNGN_FLOOR && grd[you.x_pos][you.y_pos] != DNGN_SHALLOW_WATER) @@ -693,7 +692,12 @@ static bool teleport_player( bool allow_control, bool new_abyss_area ) && grd[you.x_pos][you.y_pos] != DNGN_SHALLOW_WATER) || mgrd[you.x_pos][you.y_pos] != NON_MONSTER || env.cgrid[you.x_pos][you.y_pos] != EMPTY_CLOUD); + + // Necessary to update the view centre. + you.moveto(you.pos()); } + crawl_view.set_player_at(you.pos(), true); + return !is_controlled; } -- cgit v1.2.3-54-g00ecf