From 6b49a7c5c4056c1fc0f4518262b7fd8c024c8852 Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 14 Sep 2008 17:31:55 +0000 Subject: Fix 2071650: don't prompt for swapping with friendlies in dangerous terrain. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6927 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 161f7269a0..e5d404d7f4 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1892,23 +1892,22 @@ bool swap_places(monsters *monster, const coord_def &loc) bool swap_check(monsters *monster, coord_def &loc) { loc = you.pos(); - const dungeon_feature_type mgrid = grd(monster->pos()); - if (mons_is_caught(monster)) + // Don't move onto dangerous terrain. + if (is_grid_dangerous(grd(monster->pos()))) { - simple_monster_message(monster, " is held in a net!"); + canned_msg(MSG_UNTHINKING_ACT); return (false); } - const bool mon_dest_okay = _habitat_okay( monster, grd(you.pos()) ); - const bool you_dest_okay = - !is_grid_dangerous(mgrid) - || yesno("Do you really want to step there?", false, 'n'); - - if (!you_dest_okay) + if (mons_is_caught(monster)) + { + simple_monster_message(monster, " is held in a net!"); return (false); + } - bool swap = mon_dest_okay; + // First try: move monster onto your position. + bool swap = _habitat_okay( monster, grd(loc) ); // Choose an appropriate habitat square at random around the target. if (!swap) -- cgit v1.2.3-54-g00ecf