summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-07 09:55:54 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-07 09:55:54 +0000
commit1c4332cbef95fdc87d42e34043129f20f210850e (patch)
tree6bf364710c0893ec0a1ef1125423b504051ca004 /crawl-ref/source/monstuff.cc
parentfaca2fd92e2ba17f40f4a5c08d4f88dd25ae7085 (diff)
downloadcrawl-ref-1c4332cbef95fdc87d42e34043129f20f210850e.tar.gz
crawl-ref-1c4332cbef95fdc87d42e34043129f20f210850e.zip
Updated .des documentation. We should probably move this to the docs directory.
[1610591] Friendlies on dangerous terrain cannot be displaced. Prompting for confirmation would be more consistent, but also more irritating. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@587 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index f5e832f4ba..e47b0915e9 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1145,10 +1145,13 @@ bool swap_places(struct monsters *monster)
int loc_x = you.x_pos;
int loc_y = you.y_pos;
- swap = habitat_okay( monster, grd[loc_x][loc_y] );
+ const int mgrid = grd[monster->x][monster->y];
+
+ swap = habitat_okay( monster, grd[loc_x][loc_y] )
+ && !is_grid_dangerous(mgrid);
// chose an appropiate habitat square at random around the target.
- if (!swap)
+ if (!swap && !is_grid_dangerous(mgrid))
{
int num_found = 0;
int temp_x, temp_y;