summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-11-02 12:38:55 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-11-02 13:15:42 +0100
commit0ba4567b4b44c9332bd978ef266f4af41c052779 (patch)
treefd801de0c1af7027cb51060b698fd6ff4fd01497 /crawl-ref
parent33ae475ef22757e91ad11da1bf0878a04be818a2 (diff)
downloadcrawl-ref-0ba4567b4b44c9332bd978ef266f4af41c052779.tar.gz
crawl-ref-0ba4567b4b44c9332bd978ef266f4af41c052779.zip
Make same square teleport no-scatter no-fail and no-contamination.
We can have either this, making SIGHUP on teleport control prompt make you randomly teleport, or forcing a teleport on reload.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/spells3.cc11
-rw-r--r--crawl-ref/source/view.cc8
-rw-r--r--crawl-ref/source/view.h2
3 files changed, 18 insertions, 3 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 3dc8033cd2..de848e0632 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -1445,7 +1445,7 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area)
while (true)
{
- show_map(pos, false);
+ show_map(pos, false, true);
redraw_screen();
#if defined(USE_UNIX_SIGNALS) && defined(SIGHUP_SAVE) && defined(USE_CURSES)
@@ -1464,6 +1464,15 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area)
mprf(MSGCH_DIAGNOSTICS, "Target square (%d,%d)", pos.x, pos.y );
#endif
+ if (pos == you.pos() || pos == coord_def(-1,-1))
+ {
+ if (!yesno("Are you sure you want to cancel this teleport?",
+ true, 'n'))
+ continue;
+ you.turn_is_over = false;
+ return (false);
+ }
+
if (you.duration[DUR_MESMERISED])
{
bool blocked_movement = false;
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 8d1062dc1b..e24cfdb1cb 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -2393,7 +2393,7 @@ static void _reset_travel_colours(std::vector<coord_def> &features)
// the player from getting "artificial" location clues by using the
// map to see how close to the end they are. They'll need to explore
// to get that. This function is still a mess, though. -- bwr
-void show_map( coord_def &spec_place, bool travel_mode )
+void show_map( coord_def &spec_place, bool travel_mode, bool allow_esc )
{
cursor_control ccon(!Options.use_fake_cursor);
int i, j;
@@ -2797,6 +2797,12 @@ void show_map( coord_def &spec_place, bool travel_mode )
#endif
case CMD_MAP_EXIT_MAP:
+ if (allow_esc)
+ {
+ spec_place = coord_def(-1, -1);
+ map_alive = false;
+ break;
+ }
default:
if (travel_mode)
{
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h
index eb065ccf8d..24efb64e9e 100644
--- a/crawl-ref/source/view.h
+++ b/crawl-ref/source/view.h
@@ -35,7 +35,7 @@ bool noisy(int loudness, const coord_def& where, const char *msg = NULL,
void blood_smell( int strength, const coord_def& where);
void handle_monster_shouts(monsters* monster, bool force = false);
-void show_map( coord_def &spec_place, bool travel_mode );
+void show_map( coord_def &spec_place, bool travel_mode, bool allow_esc = false );
bool check_awaken(monsters* monster);
int count_detected_mons(void);
void clear_map(bool clear_items = true, bool clear_mons = true);