diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-14 17:31:55 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-14 17:31:55 +0000 |
commit | 6b49a7c5c4056c1fc0f4518262b7fd8c024c8852 (patch) | |
tree | 6da8f75e86a0d5394bc7d268b67a59f47bceec8e | |
parent | 6c4e2411eda3b895df30a9d7defc4c2a8bc6bc16 (diff) | |
download | crawl-ref-6b49a7c5c4056c1fc0f4518262b7fd8c024c8852.tar.gz crawl-ref-6b49a7c5c4056c1fc0f4518262b7fd8c024c8852.zip |
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
-rw-r--r-- | crawl-ref/source/monstuff.cc | 19 |
1 files changed, 9 insertions, 10 deletions
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) |